I have some regex I run over an entire HTML page looking for strings and replacing them, however if the string is in single or double quotes I do not want it to match.
Current Regex: ([a-zA-Z_][a-zA-Z0-9_]*)
I would like to match steve,john,cathie and john likes to walk (x3)
but not "steve", 'sophie' or "john"'likes'"cake"
I have tried (^")([a-zA-Z_][a-zA-Z0-9_]*)(^") but get no matches?
Test Cases:
(steve=="john") would return steve
("test"=="test") would not return anything
(boob==lol==cake) would return all three
Try this one:
Against this string:
It would match nr 1
john, nr 3Michaeland nr 5elt0n_john