As many have stated there is no standard library, fortunately I have written a Javascript implementation that does exactly what you require. With some minor limitation it works for regular expressions supported by Javascript. see: incr-regex-package.
Further there is also a react component that uses this capability to provide some useful capabilities:
- Check input as you type
- Auto complete where possible
- Make suggestions for po