2008年2月27日星期三

Boost regex Regular Express

[[:digit:]] 数字
[[:word:]] 字符加底划线

[:a-zA-Z:] 自定义字符集

\\\\ 一条\

Symbol Meaning
c Match the literal character c once, unless it is one of the special characters.
^ Match the beginning of a line.
. Match any character that isn't a newline.
$ Match the end of a line.
| Logical OR between expressions.
() Group subexpressions.
[] Define a character class.
* Match the preceding expression zero or more times.
+ Match the preceding expression one ore more times.
? Match the preceding expression zero or one time.
{n} Match the preceding expression n times.
{n,} Match the preceding expression at least n times.
{n, m} Match the preceding expression at least n times and at most m times.
d Match a digit.
D Match a character that is not a digit.
w Match an alpha character, including the underscore.
W Match a character that is not an alpha character.
s Match a whitespace character (any of t, n, r, or f).
S Match a non-whitespace character.
t Tab.
n Newline.
r Carriage return.
f Form feed.
m Escape m, where m is one of the metacharacters described above: ^, ., $, |, (), [], *, +, ?, , or /.

重要参考:
http://blog.chinaunix.net/u2/62093/showart_484483.html

没有评论: