Quantcast
Channel: Getting an ESLint: Unnecessary escape character - Stack Overflow
Browsing latest articles
Browse All 3 View Live

Answer by Dylan for Getting an ESLint: Unnecessary escape character

Unnecessary escape character means you have a \ in front of a character in your regex that you don't actually need.I plugged the code you posted into https://eslint.org/demo and got:1:20 - Unnecessary...

View Article


Answer by Nicolas Hevia for Getting an ESLint: Unnecessary escape character

You have some unnecesary escape characters:\/\*\{\}You can fix it:if (!/^[a-zA-Z0-9\\/*+;&%?#@!^()_="\-:~`|[\]{}\s]*$/i.test(e.target.value)) { this.setState({ newFamilyName: e.target.value, });}Or...

View Article


Getting an ESLint: Unnecessary escape character

I'm trying to validate a text field but, I'm getting an error for the below regex expression. if (!/^[a-zA-Z0-9\\\/\*+;&%?#@!^()_="\-:~`|[\]\{\}\s]*$/i.test(e.target.value)) { this.setState({...

View Article
Browsing latest articles
Browse All 3 View Live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>