I'm trying to find all occurrences of some code unless that code is preceded by a comment.
Here's an example of what I want to find:
$page_content .= '<meta http-equiv="refresh"
or
$page_content .= 'Some other text here</p><meta http-equiv="refresh"
With or without preceding white space. Here's what I want to ignore
//$page_content .= '<meta http-equiv="refresh"
again with or without preceding white space.
That way I can be sure that my code base never contains this code unless it's in a comment or set up an automatic alert if it is found without getting false alerts for when its commented out (ignore multi-line comments for now).
I've tried using look behind
(?<!\/\/).*<meta http-equiv="refresh"
but I've not had much luck as this still matches every occurrence, commented or not.
One more thing: It would be great if it was in one regex rather in a loop of code so that I can search in Notepad++ or other editor that supports reg exp searches. (Its amazing how differently one question can be read/understood. I'd thought I'd been pretty clear but from the variety of completely valid answers its clear that I could have included a lot more detail :-)