(...) (Expression group)
|Top Previous Next|
Parentheses are used for grouping in regular expressions as in arithmetic. They are often used with the '|' OR functionality to group alternatives.
The expression '12 Mar(ch)? 2000' would find the string '12 March 2000' and '12 Mar 2000'. Note the use of the '?' zero or more occurrence character.
If you entered the filename as the expression '^myfile\.(txt|doc)$' it would find any file that whose name was 'myfile.txt' or 'myfile.doc'. Note the use of the '^' beginning of the string character, the '\' escape character to treat the '.' in '.txt' literally, and the '$' end of the string character.