Regular Expressions 101

Find comments or commentblocks in Code V1.01

Open Workspace
  • PCRE (Legacy)
  • Match
-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