Python Regex To Avoid A Character Earlier In The String
I'd like to use a regex to find an exact string, but not if it's part of a comment, as designated by //. So for example, in the string: hello apple apples // eat an apple It shou
I think you just need to escape your comment for the lookbehind assertion;
(?<!\/\/)\b(apple)\b ## doesn't work, don't use this.
You may like these posts
Post a Comment for "Python Regex To Avoid A Character Earlier In The String"