[pcre-dev] ability to name a regexp and reuse it in another …

Kezdőlap
Üzenet törlése
Szerző: Philippe Strauss
Dátum:  
Címzett: pcre-dev
Tárgy: [pcre-dev] ability to name a regexp and reuse it in another one
Hello PCRE developpers,

I find myself the last few days writing pcre regexp like :

"^([\\p{Latin}\\-]+)\\s(?i:v|var)(?::|\\.|\\s)\\s?([\\p{Latin}\\-]+)\\s(?i:f|forme)(?::|\\.|\\s)\\s?([\\p{Latin}\\-]+)$"

the double backslash beeing a thing of the String module of the host language, ocaml here.

Is there any plan to add a feature enabling the user to name a part of a regexp like :

[\p{Latin}\-]+

(which is just a souped up \w+)

and reuse it later, would allow more readable writing of long regexp.
(in that particular case, the naming could be \w, redifining \w)

would be a really nice feature !

Note that I'm subscribing to this list just to ask about this, sorry if it's an FAQ.

--
Philippe Strauss
http://www.strauss-acoustics.ch/