All the data you need.

Tag: Regular Expressions

A shell one-liner to search directories
I started this post by wanting to look at the frequency of LaTeX commands, but then thought that some people mind find the code to find the frequencies more interesting than the frequencies themselves. So I’m splitting this into two posts. This post will look at the shell one-liner to …
Tutorial: Python Regex (Regular Expressions) for Data Scientists
In this tutorial, learn how to use regular expressions and the pandas library to manage large data sets during data analysis. The post Tutorial: Python Regex (Regular Expressions) for Data Scientists appeared first on Dataquest.
Why can’t grep find negative numbers?
Suppose you’re looking for instances of -42 in a file foo.txt. The command grep -42 foo.txt won’t work. Instead you’ll get a warning message like the following. Usage: grep [OPTION]... PATTERN [FILE]... Try 'grep --help' for more information. Putting single or double quotes around -42 won’t help. The problem is …
Why doesn’t grep work?
If you learned regular expressions by using a programming language like Perl or Python, you may be surprised when tools like grep seems broken. That’s because what you think of as simply regular expressions, these tools consider extended regular expressions. Tell them to search on extended regular expressions and some …
Regular expressions and special characters
Special characters make text processing more complicated because you have to pay close attention to context. If you’re looking at Python code containing a regular expression, you have to think about what you see, what Python sees, and what the regular expression engine sees. A character may be special to …
Why are regular expressions difficult?
Regular expressions are challenging, but not for the reasons commonly given. Non-reasons Here are some reasons given for the difficulty of regular expressions that I don’t agree with. Cryptic syntax I think complaints about cryptic syntax miss the mark. Some people say that Greek is hard to learn because it …