Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2005-04-01 04:58:23


> I would like to know if it's possible to assign an alias/name to a
> sub-expression. When using short regex there is no problem nor confusion
> but when using a long regex then I get lost looking at the correct index
> to use. It would be much easier if I can assign an alias.
>
> So, instead to use a regex like this:
>
> "\s*(\d+)\s+(\d+)\s+(\d+)\s+"
>
> I would like to be able to use something like:
>
> "\s*([$VALUE1]\d+)\s+([$VALUE2]\d+)\s+([$VALUE3]\d+)\s+"
>
> I don't know if this feature exists in regex but I haven't found it but
> maybe I dind't know where to find...

No that's not supported, but don't forget that you can always use
non-marking parenthesis to avoid throwing out too many fields.

John.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net