There are some special characters in Regular Expressions.Within a pattern,all characters except .,|,(,),[,],{,},+,\,^,$,*,and ? match themselves.They are the special characters.If you know their meaning in the Regular Expressions you can know why are they special.If you want to use themselves in patterns,you need add '\' before them.The following are the meaning of them:
- '.':represents any character except a newline
- '|':Its meaning is 'or'
- '(' and ')':
- '[' and ']':A character class is a set of characters between brackets:[characters] matches any single character between the brackets.
- '{' and '}':
- '+':follow a character or a () expression to express the character or expression must contains more than one times.
- '\':
- '^':a anchor.match the begining of a line
- '$':a anchor.match the end of a line or ...
- '*':
- '?':