in reply to perl equiv regex for C strtol
That’s a really good response (fav’d), because it focuses on what is wanted instead of what surrounds it (as, I alas must confess, my solution probably would have done). The /g modifier works really well here, because with it you can match multiple times in the same string.
from perldoc perlre: g and c Global matching, and keep the Current position after failed matching. Unlike i, m, s and x, these two flags affect the way the regex is used rather than the regex itself. See "Using regular expressions in Perl" in perlretut for further explanation of the g and c modifiers.