The X asked for a regex, not a command-line parameter. It's possible that the user was actually using POSIX grep, in which case Y ("don't invert the regex, use this command-line parameter to invert what's done with the result of the regex") is the answer they actually need. It's also possible that they're using some other tool, which they know implements POSIX-compatible regexes, but doesn't have an easy way to invert the usage; in which case the user really does need an answer to X (i.e., a way to invert the regex).
And how do I enable Perl regex for e.g., the Snowflake SQL regex functions? ;)
I’m laughing because I had this exact XY problem. Searched StackExchange for a potential workaround for a certain regex I wanted to match, and the answer said to use Perl regexes instead. Cool... except as far as I can’t tell the database we use doesn’t support that. I rolled my eyes and went to look at other search results.