Regular Expressions

Several Tcl commands, including regexp, support the use of regular expressions:

regex | regex

Match either expression.

regex *

Match zero or more of regex.

regex +

Match one or more of regex.

regex ?

Match zero or one of regex.

.

Any single character except newline.

^

Match beginning of string.

$

Match end of string.

c

Match character c.

c

Match character c.

[abc]

Match any character in set abc.

[^abc]

Match characters not in set abc.

[a-z]

Match range of characters a through z.

[^a-z]

Match characters not in range a through z.

(regex)

Group expressions.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset