http://www.perlmonks.org?node_id=642690

lima1 has asked for the wisdom of the Perl Monks concerning the following question: (regular expressions)

I need the position of a regular expression match. For example:
$a = "foo 123 bar"; if ($a =~ m{\d+}xms) { # code that returns 4, the position of 123 }

Originally posted as a Categorized Question.