This man page describes the [regular expression] syntax supported within Tcl: http://www.purl.org/tcl/home/man/tcl8.5/TclCmd/re_syntax.htm See also [Regular Expression Examples]. Here are examples of more complex syntax of regular expressions [Advanced Regular Expression Examples]. ---- If someone were so inclined, it would be useful to add, to this page, some examples of how to use some of the more complex regular expression syntax functions. ''They were - see above - [buchs]'' For instance: atom: a grouping of 0 or more characters which are to be treated as one entity by subsequent metacharacters, etc. If more than one character is to be included in an atom, then some sort of grouping syntax is needed. bracket expression: aka a regular expression class, this text, enclosed like this - [[ stuff ]] - where stuff is one or more single characters. A regular expression of [[a-z]] means that the atom can be any ASCII lower case alphabetic character . A regular expression of [[^a-z]] means that the atom can be any ASCII character '''EXCEPT''' a lower case alphabetic character. The bracket expression can contain various ranges of characters. branch: {ABC|DEF} indicates that either the ''atom'' ABC or the atom DEF should match. escape: an escape is one of a small set of characters preceeded by \ metasyntax: a sequence of (?xyz) where xyz is one or more alphabetic characters affecting the rest of the regular expressions. [[NOTE: metasyntax is one place where a variety of examples would be useful!]] quantifier: A metacharacter appended to a regular expression atom to indicate the number of times that atom may exist. ---- Many threads in [the comp.lang.tcl newsgroup] have inspired wonderful instances of RE explication. [Michael A. Cleverly], for example, wrote a delightful one: [http://groups.google.com/groups?q=re_syntax+group%3acomp.lang.tcl*&hl=en&lr=&ie=UTF-8&scoring=d&selm=Pine.LNX.4.33.0206232031300.3419-100000%40gibraltar.cleverly.com&rnum=2] on "Extracting numbers from text strings, removing unwanted characters". ---- !!!!!! [Arts and crafts of Tcl-Tk programming] %| [Tcl syntax help] | [Category Command] | [Category String Processing] |% !!!!!!