Validate pattern against the length cap and the catastrophic-shape
check. Throws UnsafeRegexPatternError when either check
rejects it; returns normally (no value) when the pattern is safe to
compile. Does not compile the pattern itself — callers still need
their own new RegExp(...), possibly after their own further
transformation (e.g. XSD → JS translation, anchoring).
Validate
patternagainst the length cap and the catastrophic-shape check. Throws UnsafeRegexPatternError when either check rejects it; returns normally (no value) when the pattern is safe to compile. Does not compile the pattern itself — callers still need their ownnew RegExp(...), possibly after their own further transformation (e.g. XSD → JS translation, anchoring).