Regular Expressions in Selection Rules

The operators ~, !~, ~~ and !~~, which perform string matching, operate with regular expressions (Tcl 8.0). These expressions use the ed syntax. For a complete description of the syntax, invoke one of the following commands:
% man -s n regexp
% man ed
The following is a short summary of the syntax for regular expressions.
  • The period "." stands for any character.
  • The asterisk "*" stands for zero or more repetitions of the previous expression.
  • The plus "+" stands for one or more repetitions of the previous expression.
  • A backslash \ can be used to escape a literal period, asterisk or plus sign.

Examples

The regular expression ".*" matches every string (any character repeated any number of times).

If you want to make a set of all the files whose name contains .std., specify the regular expression "\.std\..*", in which "\." matches the period.