Regexp-Exhaustive reviews

cpanratings
 

RSS | Module Info | Add a review of Regexp-Exhaustive

Regexp-Exhaustive (0.04) *****

This module allows you to find all the ways that a regexp matches, not just the first one it finds.

Essentially it works by appending the following to the end of the supplied regexp:

(?{ record_match(); })(*FAIL)

Every match that makes it to the end of your regexp will have its offset and length (and, very importantly, $^R) recorded. Then the regexp will be artificially FAILed, invoking the regexp engine's backtracking behaviour in order to find the next match.

This module is careful not to needlessly copy your supplied input string which is nice for efficiency.

Not useful that often, but very useful when you need it.

Doug Hoyte - 2013-10-22T22:19:32 (permalink)

3 out of 3 found this review helpful. Was this review helpful to you?  Yes No