Lorenzo Mele - greenkey
a sequence of characters that define a search pattern
[wikipedia]
/abc/
abc abcde abde bcde
they're very powerful when you need to quickly find strings in big files
known patterns to analyze
http://xkcd.com/208/
almost every technology and programming language
grep/egrep
sed
awk/gawk
almost every technology and programming language
grep/egrep
sed
awk/gawk
«Here's a ton of log files, you have to find all the error lines.»
"Here's a ton of log files, you have to find all the error lines."
«That's, fine. Now we need just the Python errors...»
«That's, fine. Now we need just the Python errors...»
«... watch out: sometimes there's a separator.»
«When I say Python, I mean Python and Jython, obviously.»
«Whwn I said Python, I meant Python and Jython, obviously.»
«Real errors have error codes...»
«Real errors have error codes...»
«... sometimes they begins with a hash...»
«... and they should be of exactly three digits.»
«Are you kidding me? Some of those lines are NOT errors!»
«Are you kidding me? Some of those lines are NOT errors!»
«This is funny... kind of. Some error lines ends with a space and that makes our system explode, don't show them.»
«This is funny... kind of. Some error lines ends with a space and that makes our system explode, don't show them.»
«The word "error" scares me, can you replace it with another one?»
«The word "error" scares me, can you replace it with another one?»
«I know they're Python errors, just remove the useless word.»
«The output is a mess, add the missing hash.»
«The output is a mess, add the missing hash.»
«That's great!»
Some people, when confronted with a problem, think
“I know, I'll use regular expressions.”
Now they have two problems.
https://blog.codinghorror.com/regular-expressions-now-you-have-two-problems/
http://stackoverflow.com/questions/1732348/regex-match-open-tags-except-xhtml-self-contained-tags/1732454#1732454