Long story short, I’m working with a library with a bug that causes a crash if I use a regex that has a caret after a bracket (for example, the regex [^a]). The bug is being worked on, and switching libraries is not an easy option, and I’d like to be able to continue work between now and when the bug is fixed.
Thus, I need to express the following two regexes without using the caret:
[^'] and [^"]
Can this be done? If so, how? It might be acceptable for now to just make a regex that contains all ascii characters, but I’m working with unicode, so that isn’t a watertight workaround.
Yes, try:
I’m assuming your regex library supports look aheads.
What it actually does is this:
In plain English: “if a single or double quote cannot be ‘seen’ when looking ahead, match any character (other than line breaks)”.