Sample Regular Expressions

Expression       

Meaning

^abc

Match "abc" at beginning of line

abc$

Match "abc" at end of line

^abc$

Match the line "abc" exactly

^\s*abc

Match "abc" at beginning of line, but allow leading whitespace

^\s*end;?\s*$

Match a line containing only "end" or "end;" with leading or trailing whitespace

abc|def

Matches either "abc" or "def"

a(b|c)d

Matches "abd" or "acd"

a(b|c)d\1

Matches "abdb" or "acdc", but it does not match "abdc"

你可能感兴趣的:(C++,c,C#)