A possibly useful tip (for those who hate back-slashes): Instead of 
backslash-escaping a space in a ?:x regex, you can also use "[ ]" (i.e., a 
single-character character class containing just a space. Personally, I find it 
easier to read.

Also, when I find myself putting a space character in a pattern, I usually stop 
and ask myself, "Would a \s make more sense (or just as much sense) here?

Regards,

        Neil Faiman

> On Jan 1, 2021, at 12:17 PM, Joe Strout <[email protected] 
> <mailto:[email protected]>> wrote:
> 
>  I had the (?x: quantifier around the whole expression (telling PCRE to 
> ignore inline comments and "most whitespace"), but was attempting to match an 
> arbitrary amount of spaces with (?: *).  The fix was to backslash-escape any 
> spaces in my pattern that I really meant to be there.


-- 
This is the BBEdit Talk public discussion group. If you have a feature request 
or need technical support, please email "[email protected]" rather than 
posting here. Follow @bbedit on Twitter: <https://twitter.com/bbedit>
--- 
You received this message because you are subscribed to the Google Groups 
"BBEdit Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/bbedit/4BD3360A-EF7A-44F3-B577-426DE733BE25%40faiman.org.

Reply via email to