[pcre-dev] [Bug 1203] desired features: match-and-substitute…

Top Page
Delete this message
Author: Philip Hazel
Date:  
To: pcre-dev
Subject: [pcre-dev] [Bug 1203] desired features: match-and-substitute and permutations
------- You are receiving this mail because: -------
You are on the CC list for the bug.

http://bugs.exim.org/show_bug.cgi?id=1203




--- Comment #6 from Philip Hazel <ph10@???> 2012-01-28 10:16:52 ---
On Fri, 27 Jan 2012, Steve Andrews wrote:

> Here, I think that an ampersand is both the sensible operator for this use,
> and is well-defined. It's sensible because the interpretation of abc&def
> is that both abc AND def must be in the string, but either order is allowed.


If that is all you want, then lookaheads can help:

/^(?=.*?abc)(?=.*?def)/

And capturing works inside positive lookaheads, so you could capture
substrings if you wanted.

Philip


--
Configure bugmail: http://bugs.exim.org/userprefs.cgi?tab=email