Академический Документы
Профессиональный Документы
Культура Документы
Quantifiers
Logic
More White-Space
Sample
Character Legend Example Match
\t Tab T\t\w{2} T ab
AB
\r\n Line separator on Windows AB\r\nCD CD
\N Perl, PCRE (C, PHP, R): one character that is not a line break \N+ ABC
Perl, PCRE (C, PHP, R), Java: one horizontal whitespace character:
\h tab or Unicode space separator
Perl, PCRE (C, PHP, R), Java: one vertical whitespace character:
line feed, carriage return, vertical tab, form feed, paragraph or line
\v separator
Perl, PCRE (C, PHP, R), Java: any character that is not a vertical
\V whitespace
Perl, PCRE (C, PHP, R), Java: one line break (carriage return + line
\R feed pair, and all the characters matched by \v)
More Quantifiers
Character Classes
One of the characters not in the Characters that are not in the
[^x-y] range from x to y [^ -~]+ printable section of the ASCII table.
Any characters, inc-
One character that is a digit or a non- luding new lines, which the regular
[\d\D] digit [\d\D]+ dot doesn't match
Word boundary
Most engines: position where one side only is an
\b ASCII letter, digit or underscore Bob.*\bcat\b Bob ate the cat
Word boundary
.NET, Java, Python 3, Ruby: position where one side Bob ate the
\b only is a Unicode letter, digit or underscore Bob.*\b\\b