or download this
index</i>, it is incorrect for it won't give you the offset you want i
+f the substring appears more than once in the input. Eg.
<c>
$ perl -E 'my $s="ME170-5/2/10-ME172-5/2/10-ME4028"; while ($s=~m|(\d{
+1,2}/\d{1,2}/\d{1,2})|g){++$x;say "$x Found $1:" . (index($s,$1)+1)}'
...
1 Found 5/2/10:7
2 Found 5/2/1:7
$