You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The escape function neglects to escape leading digits, which means it doesn't actually work in all contexts:
// ten characters, followed by the first character again, followed by the user inputletgetMatch=input=>newRegExp(`^(.)(.)(.)(.)(.)(.)(.)(.)(.)(.)\\1${escape(input)}$`);// seems to work!console.log(getMatch('x').test('abcdefghijax'));// true// unless the user input starts with a 0...console.log(getMatch('0').test('abcdefghija0'));// falseconsole.log(getMatch('0').test('abcdefghijj'));// true
The text was updated successfully, but these errors were encountered:
The escape function neglects to escape leading digits, which means it doesn't actually work in all contexts:
The text was updated successfully, but these errors were encountered: