On Tue, 9 Jul 2013 11:34:55 +0200, Boris Lenz wrote:

>does
>
>/(?!)/
>
>work for you?
>
Thanks!  I never woulda thoughta that.  Seems to work for sed and
grep; nearly an exhaustive sample.  Now I need to try to understand it:

It matches any string which is not ("!") matched by 0 or 1 ("?") copies
of the null string (which appears between "(" and "?").  The "(" and ")"
indicate grouping.  I have no idea why that's necessary.  Perhaps
operator precedence?  Would any of /(?!)/, /(?)!/, or even /()?!/ work
alike?  Why not?

And, of course, there are many flavors of regex, all with different rules.

Thanks again,
gil

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to