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
/
(?:\r\n|\n|^)(?:[^'"])*?(?:'(?:[^\r\n\\']|\\'|[\\]{2})*'|"(?:[^\r\n\\"]|\\"|[\\]{2})*")*?(?:[^'"])*?(\/\*(?:[\s\S]*?)\*\/|\/\/.*)
/
g
Input 1
1
New
/* block 1 multi */ var b = function(){ /* block 2 contained */ }; "/* invalid block */"; "\" /* invalid block tricky */"; "\\ \\\""; /* valid block tricky */ // Ignore Case: note - collapse regex first, then block comments var trickiest = /\/* invalid block trickiest */gmi;
Substitution