![]() |
Available news archives:
comp.lang.tcl
-
comp.lang.python
-
comp.security.firewalls
-
sci.crypt -
comp.lang.php -
comp.lang.javascript
|
|
comp.lang.php archiveRe: REGEX: Quotes still captured, don't want them
From: Janwillem Borleffs <jw@jwscripts.com>
Date: Sun Jul 31 2005 - 22:50:25 CEST
Robert Oschler wrote:
The (?:...) syntax does capture the specified character sequences; what you
'/(?<=\\\")([^\"]+)[^\s](?=\\\")/i'
Mind the [^\s]; I have put it there to distinguish between \"bean bags\" and
> 3) Why did only one of the slashes get captured?
Because you didn't mark the backslashes as literal characters, as in:
'/(?:\\\").*?(?:\\\")/i' (Also note the single quotes enclosing the pattern)
JW
|