Refine #1192 to allow extraction of multiple subpatterns in regex validator, closes #1238 and closes #1192