Please enable JavaScript to use regex101
/
^
r
e
g
e
x
[
\
-
_
]
?
1
0
1
$
/
i
Reg
ular
Ex
pressions
101
Upgrade to Pro
Enterprise
Community Library
How to contribute
x
Find comments or commentblocks in Code V1.01
Open Workspace
PCRE (Legacy)
Match
Created 2015-12-30 15:09
-1
Regular Expression
/
(
(?<raute>
#
(?<raute_content>
[^
\n
]
*
)
)
|
(?<doubleslashes>
\/\/
(?<doubleslashes_content>
[^
\n
]
*
)
)
|
(?<block>
\/\*
(?<block_content>
[^
*
]
+
|
\*
(?!
\/
)
)*+
\*\/
)
)
/
gm
Description
Find Comments starting with # or //. Also finds Commentblocks starting with /* and ending with */.
Submitted by
Candyman1332