How do I turn any regex into an complement of itself without complex hand editing?

Viewed 21519

The following are pseudo examples, not real regex, but still an example of what I mean:


.* (anything)

-.* (NOT anything)

[A-Z] (Any letter A to Z, caps only)

-[A-Z] (NOT any letter A to Z, caps only)

EDIT: Changed inverse into complement in the question. Here's where the change was made: "turn any regex into an complement of itself "

6 Answers
Related