|
|
Regular Expressions SyntaxLiteralsAll characters are taken literally except the following:".", "|", "*", "?", "+", "(", ")", "{", "}", "[", "]", "^", "$" and "\". These characters have special meaning and must be preceded by a "\" to be taken literally. WildcardsThe dot "." matches any characters including new line symbols [CR] and [LF].RepeatsAn expression followed by "*" can be repeated any number of times including zero.An expression followed by "+" can be repeated any number of times excluding zero. An expression followed by "?" can be repeated no more than one time. The bounds "{" "}" may be used to specify number of repetitions: "{N}" means that the expression must be repeated N times, "{N,M}" means that the expression must be repeated N to M times. Subexpressions and parenthesisParenthesis "(" ")" are used to mark subexpressions which which are counted starting from 1 from left to right. Subexpression zero is the whole match of the expression.AlternativesAlternative expressions are separated by "|" or put on separate lines in the expression.Line anchorsThe empty string at the beginning of line is matched by "^" character.The empty string at the end of line is matched by "$" character. Text anchors"\`" matches the start of the whole text."\A" matches the start of the whole text. "\'" matches the end of a whole text. "\z" matches the end of a whole text. "\Z" matches the end of a whole text, or any new line characters at the end. Character setsThe character set enclosed in brackets "[" "]" matches any symbol it contains, for example "[abc]" matches either "a", "b" or "c".Sets that start with "^" matches any character that is not member of the set, for example "[^abc]" matches any character except "a", "b" and "c". Character ranges can be specified as "[a-d]", which matches any symbol betweed "a" and "d". Character classes are denoted by "[:class:]" within a set declaration. Commonly used character sets are:
Character codesThe characters may be matched by octal code "\0NNN" or hexademical code "\xHH", enclosed in brackets "{" "}" if necessary: "\0{NNN}" "\x{HH}".Word operators"\<" matches the null string at the start of a word."\>" matches the null string at the end of the word. "\b" matches the null string at either the start or the end of a word. "\B" matches a null string within a word. The beginning of the text is a potential start of the word and the end of the text is a potential end of the word. Back referencesSubexpressions may be identified and the matched text used further in the expression by labels "\1" to "\9".Miscellaneous escape sequences
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Privacy Statement | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||