I have the following question extracted from a tutorial:
Write RE to describe comments consisting of a line surrounded by / * and * / without alternating / * or * / if it does not appear between quotation marks ""
Here is my attempt:
^/[*].*(".*(/[*].*[*]/)*.*")*[*]/$
EDIT:
I used:
http://gskinner.com/RegExr/
It works as follows:
" comment */fdgh
It's hard for me to debug a regex. Can you tell me where I will be if this is not true.
source
share