[Development] QRegularExpression -- first round of API review

Thiago Macieira thiago.macieira at intel.com
Tue Jan 17 13:40:59 CET 2012


On Tuesday, 17 de January de 2012 02.43.33, Giuseppe D'Angelo wrote:
> 2) Support for named capturing groups with duplicated names. The point
> is that this may require a couple of additional accessors inside
> QRegularExpressionMatch to extract all the substrings captured by a
> given name.
> The long story is that with default options, having a name occurring
> in different named capturing groups is illegal, unless either
> - the proper pattern option is set;
> - the named capturing groups with the same name have the same number too*;
> - the (?J) option appears in the pattern string enabling duplicated names.
> * (a named capturing group still follows the "ordinary", progressive
> numbering; a branch group (?|...) that resets the number in each
> branch allows to have capturing groups with the same name and
> number).
> 
> Opinions for this feature?

Keep it disabled for the moment. Having the same name in more than one group 
would be undefined behaviour until we define it. You can even write that in the 
documentation.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center
     Intel Sweden AB - Registration Number: 556189-6027
     Knarrarnäsgatan 15, 164 40 Kista, Stockholm, Sweden
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 190 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.qt-project.org/pipermail/development/attachments/20120117/6cd2e109/attachment.sig>


More information about the Development mailing list