in reply to Re: A NOT in regular expressions (and what else?)
in thread A NOT in regular expressions

There will be most likely be % and > in the resulting string but there won't be a %> together in the string

Thanks
Bruce
  • Comment on Re: Re: A NOT in regular expressions (and what else?)

Replies are listed 'Best First'.
Re^3: A NOT in regular expressions (and what else?)
by tye (Sage) on May 14, 2003 at 07:54 UTC

    Either solution will handle that.

    The simple solution will often not work if it is part of a larger regex. For example,

    /<%(.*?)%> home <%(.*?)%>/ =~ "Go <% now %> to <% your %> home <% if %> you <% can %>" # ^^(^^^^^^^^^^^^^^^^^)^^^^^^^^^^(^^)^^
    will match as shown on that third line. Note that the first part matches too much. This is because a non-greedy part prefers to match sooner at the expense of being "more greedy" than to fail to match or to match later.

                    - tye