in reply to pull out num from str

$ perl -MRegexp::Common -E 'say $RE{num}{int}' (?:(?:[+-]?)(?:[0123456789]+))

Replies are listed 'Best First'.
Re^2: pull out num from str
by icoder (Novice) on Apr 23, 2012 at 14:03 UTC
    In what ways the above regex is better than this one ? m/([+-]?\d+)/ suggestion needed
      Well, it's "better" in the sense that it doesn't match on a sequence of digits thrown together from a couple of handful of different scripts.

      But I posted it mainly to point you to the Regexp::Common module. Useful if you need patterns for common tasks, but you aren't able to write them yourself without asking on the internet.

        okay.Yes ..I want to get anyother better way to do it without any failure cases for tests,that is why asked for suggestion.