Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Regular
Expressions
101
Regular
Expressions
101
Upgrade to Pro
Enterprise
Regular Expression
/
#(?=(?:[^"'`]*"[^"'`]*")*(?:[^"'`]*'[^"'`]*')*(?:[^"'`]*`[^"'`]*`)*[^"'`]*$)
/
gim
Test String
New
#somecomment # some comment "#not a commnet" #another comment '#not a comment' jquery_code = "$('#some-identifier')[0].click()"#yet a comment, but the identifier :( jquery_code = '$("#some-identifier")[0].click()' # just another comment