I am trying to write a regex that will detect the following type of comment:
- Starts with one
#and continues to the end of the line. - Will treat any escaped
#( \#) as plain text (this way it won’t do anything after it if it wasn’t already)
Using this tool , I came up with the following regular expression for this:
(?!\\)(
Using it in global mode, I checked it for the following introductory text, which is pretty clear:
While none of this line this should be \
Now matches for this regex:
- Whole first row
- Everything on the second line, starting from the first
#, but not including \before
, - . , , ?