next up previous contents
Next: Examples Up: Text Search Previous: Text Search

Regular Expressions

Regular expression are a lot more powerful though. We can search for lines containing the word 'file' not preceeded by 'old'. We can search for empty lines, lines which contain one word or another. To be able to do this it is necessary to understand the syntax and grammar of regular expressions. A regular expression is always tried to be matched against some text. If a match succeeds grep will print that line.

In some versions of grep the following characters have to be preceeded by a '\': ?, +, {, |, (, ).





Mark O. Stitson
Wed Sep 25 10:45:32 BST 1996