O'Reilly logo

Practical Programming in Tcl & Tk, Third Edition by Brent B. Welch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Syntax Summary

Table 11-1 summarizes the syntax of regular expressions available in all versions of Tcl:

Table 11-1. Basic regular expression syntax.
.Matches any character.
*Matches zero or more instances of the previous pattern item.
+Matches one or more instances of the previous pattern item.
?Matches zero or one instances of the previous pattern item.
( )Groups a subpattern. The repetition and alternation operators apply to the preceding subpattern.
|Alternation.
[ ]Delimit a set of characters. Ranges are specified as [x-y]. If the first character in the set is ^, then there is a match if the remaining characters in the set are not present.
^Anchor the pattern to the beginning of the string. Only when first.
$Anchor the pattern to the end of the string. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required