Implementation restriction: The counting forms , , and reject forms that create a minimum or maximum repetition count above 1000. Unlimited repetitions are not subject to this restriction. x{n,m}x{n,}x{n}
Possessive repetitions
x*+
zero or more , possessive (NOT SUPPORTED) x
x++
one or more , possessive (NOT SUPPORTED) x
x?+
zero or one , possessive (NOT SUPPORTED) x
x{n,m}+
n or … or , possessive (NOT SUPPORTED) mx
x{n,}+
n or more , possessive (NOT SUPPORTED) x
x{n}+
exactly , possessive (NOT SUPPORTED) nx
Grouping
(re)
numbered capturing group (submatch)
(?P<name>re)
named & numbered capturing group (submatch)
(?<name>re)
named & numbered capturing group (submatch)
(?'name're)
named & numbered capturing group (submatch) (NOT SUPPORTED)
(?:re)
non-capturing group
(?flags)
set flags within current group; non-capturing
(?flags:re)
set flags during re; non-capturing
(?#text)
comment (NOT SUPPORTED)
(?|x|y|z)
branch numbering reset (NOT SUPPORTED)
(?>re)
possessive match of (NOT SUPPORTED) re
re@>
possessive match of (NOT SUPPORTED) VIM re
%(re)
non-capturing group (NOT SUPPORTED) VIM
Flags
i
case-insensitive (default false)
m
multi-line mode: and match begin/end line in addition to begin/end text (default false)^$
s
let match (default false).\n
U
ungreedy: swap meaning of and , and , etc (default false)x*x*?x+x+?
Flag syntax is (set) or (clear) or (set , clear ). xyz-xyzxy-zxyz
Empty strings
^
at beginning of text or line (=true)m
$
at end of text (like not ) or line (=true)\z\Zm
\A
at beginning of text
\b
at ASCII word boundary ( on one side and , , or on the other)\w\W\A\z
\B
not at ASCII word boundary
\g
at beginning of subtext being searched (NOT SUPPORTED) PCRE
\G
at end of last match (NOT SUPPORTED) PERL
\Z
at end of text, or before newline at end of text (NOT SUPPORTED)
\z
at end of text
(?=re)
before text matching (NOT SUPPORTED) re
(?!re)
before text not matching (NOT SUPPORTED) re
(?<=re)
after text matching (NOT SUPPORTED) re
(?<!re)
after text not matching (NOT SUPPORTED) re
re&
before text matching (NOT SUPPORTED) VIM re
re@=
before text matching (NOT SUPPORTED) VIM re
re@!
before text not matching (NOT SUPPORTED) VIM re
re@<=
after text matching (NOT SUPPORTED) VIM re
re@<!
after text not matching (NOT SUPPORTED) VIM re
\zs
sets start of match (= \K) (NOT SUPPORTED) VIM
\ze
sets end of match (NOT SUPPORTED) VIM
\%^
beginning of file (NOT SUPPORTED) VIM
\%$
end of file (NOT SUPPORTED) VIM
\%V
on screen (NOT SUPPORTED) VIM
\%#
cursor position (NOT SUPPORTED) VIM
\%'m
mark position (NOT SUPPORTED) VIM m
\%23l
in line 23 (NOT SUPPORTED) VIM
\%23c
in column 23 (NOT SUPPORTED) VIM
\%23v
in virtual column 23 (NOT SUPPORTED) VIM
Escape sequences
\a
bell (≡ \007)
\f
form feed (≡ \014)
\t
horizontal tab (≡ \011)
\n
newline (≡ \012)
\r
carriage return (≡ \015)
\v
vertical tab character (≡ \013)
\*
literal , for any punctuation character **
\123
octal character code (up to three digits)
\x7F
hex character code (exactly two digits)
\x{10FFFF}
hex character code
\C
match a single byte even in UTF-8 mode
\Q...\E
literal text even if has punctuation......
\1
backreference (NOT SUPPORTED)
\b
backspace (NOT SUPPORTED) (use \010)
\cK
control char ^K (NOT SUPPORTED) (use etc)\001
\e
escape (NOT SUPPORTED) (use \033)
\g1
backreference (NOT SUPPORTED)
\g{1}
backreference (NOT SUPPORTED)
\g{+1}
backreference (NOT SUPPORTED)
\g{-1}
backreference (NOT SUPPORTED)
\g{name}
named backreference (NOT SUPPORTED)
\g<name>
subroutine call (NOT SUPPORTED)
\g'name'
subroutine call (NOT SUPPORTED)
\k<name>
named backreference (NOT SUPPORTED)
\k'name'
named backreference (NOT SUPPORTED)
\lX
lowercase (NOT SUPPORTED) X
\ux
uppercase (NOT SUPPORTED) x
\L...\E
lowercase text (NOT SUPPORTED) ...
\K
reset beginning of (NOT SUPPORTED) $0
\N{name}
named Unicode character (NOT SUPPORTED)
\R
line break (NOT SUPPORTED)
\U...\E
upper case text (NOT SUPPORTED) ...
\X
extended Unicode sequence (NOT SUPPORTED)
\%d123
decimal character 123 (NOT SUPPORTED) VIM
\%xFF
hex character FF (NOT SUPPORTED) VIM
\%o123
octal character 123 (NOT SUPPORTED) VIM
\%u1234
Unicode character 0x1234 (NOT SUPPORTED) VIM
\%U12345678
Unicode character 0x12345678 (NOT SUPPORTED) VIM
Character class elements
x
single character
A-Z
character range (inclusive)
\d
Perl character class
[:foo:]
ASCII character class foo
\p{Foo}
Unicode character class Foo
\pF
Unicode character class (one-letter name)F
Named character classes as character class elements
[\d]
digits (≡ \d)
[^\d]
not digits (≡ \D)
[\D]
not digits (≡ \D)
[^\D]
not not digits (≡ \d)
[[:name:]]
named ASCII class inside character class (≡ [:name:])
[^[:name:]]
named ASCII class inside negated character class (≡ [:^name:])
[\p{Name}]
named Unicode property inside character class (≡ \p{Name})
[^\p{Name}]
named Unicode property inside negated character class (≡ \P{Name})