in reply to Identifying the position of match using regular expressions
Look at the special variables @- and @+.