Forum Moderators: open
/(?<=")\/\//. In JavaScript it will throw a compilation error.
Me thinks you'll have to do this in two steps.
/(^¦[^"'])\/\/([^"']¦$)/
It returns a match for two forward slashes that are
- preceeded by either start of line or any character that is not a quote character
AND
- followed by either end of line or any character that is not a quote character
Only downside I see is that it will also match a string like
hello '//". That can be fixed by making separate patterns for single and double quotes:
/((^¦[^'])\/\/([^']¦$)¦(^¦[^"])\/\/([^"]¦$))/
(replace the broken pipes ¦ by solid ones)