That's not at all easily doable, and in a lot of cases,
the answer wouldn't be useful at all. It could well be
that you have a pattern that matches a string almost,
except a 'last' character. But the optimizer could already
have noticed that last character isn't in the string, so
Perl doesn't even attempt the match. So there wouldn't be
any logical value for
pos to return.
Furthermore, if you do:
"doghouse" =~ /doghair|cathouse/;
How far did that match? 3 characters? Or 0? And what about:
"ababa" =~ /^(?>.*)b/
How far did that "match"?
Abigail