#1 2009-06-25 07:40

animeaime
Member
Registered: 2009-06-25
Posts: 2

Remove limit for capture groups in RegEx

I designed a tool that is capable of converting PCRE (Pearl Compatable Regular Expressions) that use more "advanced" RegEx syntax (e.g. named subpatterns, conditionals, "branch reset" subpatterns) to an equivalent RegEx that uses more "basic" syntax, so that the pattern can be used in text editors and the like.  Right now, I'm finishing up testing before I put the tool on the market, and I wanted to verify the the tools I use and love had the ability to handle the refactored RegExes.

The main limitation which I keep running into is that many programs cannot support backreferences to groups higher than 9 (which Renamer handles fine), and the second is that the number of capture groups are limited (which Renamer limits them to 14; 15 groups throws an error).

For some of the groups, the refactored RegEx would use non-capture groups, but as these are not supported, it refactors them as capture groups.


I'm hoping that there is a workaround for this, or that this limitation can be removed, because I plan to keep a list of programs and the limitations that their RegEx engine puts on the refactoring tool.  I'm posting on the forums of all the programs that I use, because I don't want these programs to have such limitations.

Offline

#2 2009-06-25 17:44

Andrew
Senior Member
Registered: 2008-05-22
Posts: 542

Re: Remove limit for capture groups in RegEx

Interesting... but since Denis uses an external freeware RegEx library (TRegExpr), I'm not sure if he can really change the way it behaves. Anyway, he's the best person to answer your question/request.

Offline

#3 2009-06-25 18:57

animeaime
Member
Registered: 2009-06-25
Posts: 2

Re: Remove limit for capture groups in RegEx

Thank you for your response.

I sent Denis an email, via "Feedback" on the main page, asking for his take and advice for the next step.  I'm also going to download TRegExpr to test it out directly.

Offline

Board footer

Powered by FluxBB