Professional Documents
Culture Documents
## Regular Expressions
---------------------A 'regular expression' (regexp) defines a set of strings.
Characters which have special meanings (* [ ^) can be avoided by
escaping them with \
## Regular Expressions Basics
----------------------------p* denotes zero or more repetitions of p
egrep 'ab*c'
a, followed by any number of b`s, followed by c
Back will work, abbc, will work, etc.
A dot matches any single character
egrep 'a.c'
a, followed by any letter, followed by c
e.g. abc, adc, aec
egrep 'Hermione.*Ron' hp?.txt
Hermione followed by any number of characters, followed by Ron.