On 1/18/15 at 3:30 PM, [email protected] (Lawrence San) wrote:
var noCol=/^transparent|rgba.*,\s?0\s?\)$/i; // Regexp for either the
traditional or the CSS3 way of expressing transparency
Can anybody see what in that code is causing BBEdit not to balance the
overall function? Does it matter? Is there some simple way I could fix that?
Looks like it's the escaped right parenthesis: \)
Out of context, it's not clear to me why that's there. But
here's a hack if you need it: add an optional escaped LEFT
parenthesis before the escaped right parenthesis and the Balance
command will probably work.
That is, add this: \(?
The '?' makes it optional - it will will match zero or one left
parenthesis, and this hack expects it to always be zero.
So you'd have, perhaps:
var noCol=/^transparent|rgba.*,\s?0\s?\(?\)$/i;
If you do this, put a comment nearby to explain why the escaped
left parenthesis is in the match expression. While you're at it,
document the whole thing. As I said, I'm unclear what that right
parens is doing there, although that would probably be clear
from seeing the surrounding code and also the material you're
matching against.
HTH
--
- Bruce
_bruce__van_allen__santa_cruz__ca_
--
This is the BBEdit Talk public discussion group. If you have a
feature request or would like to report a problem, please email
"[email protected]" rather than posting to the group.
Follow @bbedit on Twitter: <http://www.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 post to this group, send email to [email protected].