Fix issue with ^ anchor in regular expressions used with "matches" operator. Make yr_re_exec easier to read.