in reply to Re: Looking for a flexible regex...
in thread Looking for a flexible regex...

beautiful! Thanks -- exactly what I was looking for.

Replies are listed 'Best First'.
Re^3: Looking for a flexible regex...
by aaron_baugher (Curate) on Sep 21, 2013 at 13:14 UTC

    Does it matter to your requirements if ranges are backwards like "5-1,10-8", or if they overlap like "1-6,3-8"? If it does, you probably won't be able to do that with a regex (though if it can be done, someone here will know how). You may need to split the string on commas and then check each section for correctness.

    Aaron B.
    Available for small or large Perl jobs; see my home node.