in reply to regular expression to match in between digits..

>perl -wMstrict -le "my $s = ',42 MAN:113 some other test 666.... MAN 231,456 TEXT' . 'text alpha Man 999 etc..77789 etc man 111,222,333' ; print qq{[[$s]]}; ;; my $man = qr{ (?i) man :? }xms; ;; my @n = $s =~ m{ (?: \G (?<! \A) \s* , | $man) \s* (\d+) }xmsg; printf qq{'$_' } for @n; " [[,42 MAN:113 some other test 666.... MAN 231,456 TEXTtext alpha Man 9 +99 etc..77789 etc man 111,222,333]] '113' '231' '456' '999' '111' '222' '333'

See perlre and the sub-section '\G assertion' in the Regexp Quote Like Operators section (and, in general, the whole Regexp Quote Like Operators section) in perlop.