Allow extraction of subpatterns in regex validator, closes #1283