in reply to Re: regexp match repetition breaks in Perl
in thread regexp match repetition breaks in Perl

That's looks too lax to me. /(?:,|and)\s\d{3}\D/ is too likely to exist. For example, your regexp would match "134" in "sections 3 and 134".

Replies are listed 'Best First'.
Re^3: regexp match repetition breaks in Perl
by johngg (Canon) on Jul 11, 2007 at 15:26 UTC
    Yes, although my way works for the data given it could easily break down as you point out. Your method is safer. I'm wondering why the OP captures the 'APC' and 'APCs' strings; they seem to have no bearing on how many sets of digits follow.

    Cheers,

    JohnGG

      I suspect it's just for debugging and that lima1 had the right idea when he/she put the numbers in a hash to filter out duplicates.