in reply to Re: pull out num from str
in thread pull out num from str

In what ways the above regex is better than this one ? m/([+-]?\d+)/ suggestion needed

Replies are listed 'Best First'.
Re^3: pull out num from str
by JavaFan (Canon) on Apr 23, 2012 at 14:16 UTC
    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.