RegExp, also known as regex or Regular Expressions, is a specialised string which can “match” text, and can also do a more advanced “search and replace” than normal string matching. It uses characters with special meaning to allow very flexible matching of strings.
abc will find any “abc” in text, like: aksjabcskabbcldga, abcasfreabababcacas
ab*c will find a letter ‘a’, followed by zero or more letters ‘b’ and one letter ‘c’, like these: fdkhjaclsdabcsldkabbbbbbbcksdd
a[bde]c will find a letter ‘a’, followed by ‘b’ or ‘d’ or ‘e’, followed by ‘c’, like: skdjacacabcaabbccadcandaecacasce
a[bde]*c will find a letter ‘a’, followed by zero or more letters ‘b’ or ‘d’ or ‘e’, followed by ‘c’, like these: asdljacandaaabdebdbbdecoppabbbbcbutalsoadcandsoon
It can be more complicated and may also act as a “search and replace”. Look:
s/\([^,]*\), \([^,]*\)/\2 \1/ (using default syntax of Vim and sed) - In a file with each line containing a name in form “Smith, John”, this RegExp, when applied to each line, converts the names to “John Smith” form.
See the Wikipedia page for a more thorough description.
Windows only -> To learn how to use regular expressions interactively, use the wonderful regular expression coach.
Vim, a very powerful but a bit difficult to learn text editor (multi-systems)
Lots of Unix/Linux utilities (sed, awk, locate, grep, egrep…)