| Expression |
Result |
| |
|
| ^They |
Finds They at the beginning of a line.
|
| Ishmael$ |
Finds Ishmael at the end of a line.
|
| Wh..e |
Finds White, Whale, While, Whole, or any other text beginning with Wh, ending with e, and having two characters between.
|
| ^Wh..e |
Finds White, Whale, While, Whole, and so on, at the beginning of a line.
|
| se* |
Finds s, se, see, seee, or any other text beginning with an s followed by zero or more occurrences of e. Finds sea too.
|
| se+ |
Finds se, see, seee, or any other text beginning with an s followed by one or more occurrences of e. Finds sea too. It does not find “s” stranded without an “e”.
|
| [MobyDick] |
Finds M, o, or any other letter in “Moby Dick”. Does not find anything in “Ishmael”. [MobyDIck] would find I in “Ishmael”.
|
| [MobyDick]+oby |
Finds Moby in “Moby Dick”.
|
| d[^aeiu]ck |
Finds dock but not “Dick” or “duck”.
|
| \<[Mm]o+[Bb]*y |
Finds text that begins a word with M or m, then has one or more of o, zero or more of B or b, and a y. Finds Moby but not “Mory”.
|
| sea|whale|leg |
Finds text that contains sea, whale, or leg.
|
| \$ |
Finds a dollar sign. The backslash turns the $ into a literal dollar sign instead of a symbol for an end of line in a regular expression.
|
| {his}{[ -z]+}{[kl]eg} |
Finds “his wooden leg” or “his whale of a leg” or “his whole keg”, as well as other such text. Except for the curly brackets, this expression is the same as his[ -z]+[kl]eg. The curly brackets divide the expression into sub-expressions, which may be referenced by number in Replacement Expressions.
|
| ([0-9]) |
matches (0), (1), (2), (3), (4), (5), (6), (7), (8) and (9)
|
| ([0-9]*) |
matches (), (0), (123), (2512), etc.
|