Exclusive matching in regex is not only much more complicated but, in many cases, not well defined. If we're talking about single characters, things are pretty clear and a [^class] takes care of this: [^abc] matches any character except a, b or c. But for strings of more than 1 letters issues arise. Not only is it hard to exclusively match, you must also make sure that parts of the string that you want to exclude aren't matched. For example, you want to match anything but "blah". Let's say you have an input string "Hello blah". What should regex match here? Just "Hello " ? Or "lah", "la", "ah" , "l", "h" etc as well? All these strings, except the first "Hello ", are inside "blah" (so the pattern that matches them doesn't have to match "blah" too). So, what you need is not only to exclusively match parts of the string but also to 'consume' the parts of the string that do match. This would mean that at least some part of the pattern must match "blah" and eat it, so that the other parts of the pattern, which exclude "blah", work correctly. According to the above, your previous example can be written like this:
//var %re | echo -a $regsub(eh.. some random text etc.. blahbleh?,/(.*?)((?:rand|text|eh|$)+)/gi,04\1\2,%re) -> %re
It's a bit of a trick but works. The only, minor, drawback is that you can end up with unecessary 04 strings in %re, but this can easily be taken care of with $remove(%re,04).
The only feature of PCRE that's indirectly related to this are assertions. You can't exactly exclude a string with assertions but you can have a peek at the string lying ahead or behind the current matching position. In some cases, this can be used for exclusive matching, like in this example, which catches every
word in a sentence excluding the word "blah":
//echo -a $regex(hello blah world bleh foo,/(?<=^|\s)(?!blah)(\w+)/gi) - $regml(0) - $regml(1) : $regml(2) : $regml(3) : $regml(4)
That's about all I can think of to address this problem, if anyone has any other idea(s) I'd be very interested to hear about it.