The question:
Forget everything below for a second, since my detail seems to be confusing people (or else this is really complicated).
I want to match, with regex, "everything except what this (any) capture group matches".
What I've tried:
I saw this question, but the answers and question all talk about one situation without actually explaining how / why the syntax works, so I cant figure it out.
I looked at "negative-look-ahead" with ?!
, but don't really understand how that achieves what I'm trying to do.
I'm trying to match everything except a capture group, for example ("[a-z]*",)
.
For example, in this multi-line list:
"buckeye",
"buckeye"
,
."
,"
"fbfdb
"feve,
How do I select everything except the capture group (which in my case should match "buckeye",
or any set of "
+ any num a-z chars + ",
) with Regex?
The reason need this is because I have a file with lots of entries such as:
"aidman",
"aidmen",
"aids",
"aiglet",
"aiglets",
"aigret",
"aigrets",
"aigrette",
"aigrettes",
"aiguille",
"aiguilles",
"aikido",
and I ran some replacements with my text editor on it to change the format, but a bunch of random things happened to ~20 of the 100,000 lines (a bug). So I need to find the improperly formatted lines.
Clarification:
My goal for this question is simply to understand how to say "I want to match everything except this capture group".