[HTTPS-E Rulesets] Uncpaturing patterns
Peter Eckersley
pde at eff.org
Tue Sep 27 14:37:24 PDT 2011
Ok. I view this as a performance/readability tradeoff. I'm not super keen on
making our regexps harder to read unless we're sure the performance win is
real and important.
Anyone know if there's a profiling technique we could use to learn how much
time Firefox spends applying our regular expressions?
On Tue, Sep 27, 2011 at 11:29:50PM +0300, Osama Khalid wrote:
> On Tue, Sep 27, 2011 at 01:07:17PM -0700, Peter Eckersley wrote:
> > What does an "uncapturing pattern" do? What are the benefits of
> > using them?
>
> Brackets create a "backreference" for the matched characters. If that
> reference is not going to be used, it's (said to be) good for
> performance to use a non-capturing brackets. This can be done by using
> "(?:)" instead of "()".
>
> http://www.regular-expressions.info/brackets.html
>
> --Osama Khalid
--
Peter Eckersley pde at eff.org
Technology Projects Director Tel +1 415 436 9333 x131
Electronic Frontier Foundation Fax +1 415 436 9993
More information about the HTTPS-Everywhere-Rules
mailing list