The regex to convert
A new regular expression that matches the entire string.
const regexMatchDigits = /\d+/gi;
const regexIsDigit = regexMatcherToValidater(regexMatchDigits); //=> /^\d+$/i
const isDigit = (str) => regexIsDigit.test(str)
isDigit('1') //=> true
isDigit('a') //=> false
Generated using TypeDoc
Convert a regex for matching to a regex for validation.