Regular expression - skip string in quotes using sed
- by milano
I have string like this:
"Some standard text CONST_INSIDE_QUOTES" blah blah CONST "There might be another quotes"
The thing is, that i want to replace all constants in string with some text, but it mustn't be applied on constants inside text in quotes. I have this regex:
sed "s/([A-Z][A-Z0-9_]*)([^a-z])/<span class=\"const\"\1<\/span\2/g"
which of course works for all consts. Any ideas how to exclude its apply on quotes constants? Unfortunately sed only...