in reply to Re^3: AND and OR on Regular Expressions
in thread AND and OR on Regular Expressions
and/pat1/ && /pat2/
aren't equivalent in the first place./(?=.*?pat1)(?=.*?pat2)/s
Note also that the OP didn't specify whether pat1 and pat2 may overlap. /pat1/ && /pat2/ has the potential to match more than /pat1.*pat2|pat2.*pat1/s. All of the presented solutions so far assume it's ok the patterns may overlap.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^5: AND and OR on Regular Expressions
by ikegami (Patriarch) on Aug 25, 2009 at 21:20 UTC | |
by JavaFan (Canon) on Aug 25, 2009 at 23:31 UTC | |
by ikegami (Patriarch) on Aug 26, 2009 at 00:50 UTC | |
by JavaFan (Canon) on Aug 26, 2009 at 07:36 UTC | |
by ikegami (Patriarch) on Aug 26, 2009 at 14:02 UTC | |
|