Replace typed-regex with plain RegExp and a namedCaptures helper (#2391)