Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Have you used the Perl 5.10 backtracking control verbs in your regexes yet? [closed]

Tags:

regex

perl

Have you used the Perl 5.10 backtracking control verbs in your regexes yet? And what problems did they help you accomplish?


Just as background: I have done some fiddling, but I can't get any really useful results.

As a comparison, when I started getting what the (?> grouping did, it started showing up more in my regexes. I liked the idea of tuning the world of Perl regex to a particular set of assumptions. As RE languages get more featured, the backtracking has made the performance of REs wildly divergent from the lean and mean FSA that they were based upon.


When someone can tell me what other implementation of REs has backtracking control verbs--and PCRE does not, I can concede that it belongs in the general area of expertise of people knowledgeable about regexes. This is a Perl regex question, and guys helping people out with Ruby, Python, C#, Javascript--or any PCRE client implementations-- probably can't help or see it as a waste of space for the tags they normally read.

like image 518
Axeman Avatar asked Oct 31 '08 14:10

Axeman


1 Answers

Yes, I have, although not too much. I use them to control backtracking, usually to force it to make more permutations. Here’s an amusing solution and here’s a practical one.

like image 87
tchrist Avatar answered Sep 26 '22 05:09

tchrist