Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
(?<!\\)(?:\\{2})*%[^\\%\r\n]*(?:\\[\w\W][^\\%\r\n]*)*\z
/
gm
Input 1
1
New
(a) last line % now with comment (b) last line with escaped \% and not treated (c) last line withouth any special chars (d) last line terminates with % (e) last line terminates with escaped \% (f) beginning % but even escaped \% is ignored
Extraction
(a) last line % now with comment (b) last line with escaped \% and not treated (c) last line withouth any special chars (d) last line terminates with % (e) last line terminates with escaped \% (f) beginning % but even escaped \% is ignored