fix issue 12582 Non-existant named capture groups cause runtime range vi...

...olation or segmentation fault in regex