in reply to Re: Re: A NOT in regular expressions (and what else?)
in thread A NOT in regular expressions
Either solution will handle that.
The simple solution will often not work if it is part of a larger regex. For example,
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/<%(.*?)%> home <%(.*?)%>/ =~ "Go <% now %> to <% your %> home <% if %> you <% can %>" # ^^(^^^^^^^^^^^^^^^^^)^^^^^^^^^^(^^)^^
|
|---|