Issue #22465:prevent invalid regex expressions
Merge pull request #471 from garyhgohoos/22465

Issue #22465:prevent invalid regex expressions