How can I make the special character check also match spaces? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

How can I make the special character check also match spaces?

https://code.sololearn.com/WhH3Q09RHeQj/?ref=app I need the special characters check to include spaces in the counter. How can I achieve this?

27th Aug 2018, 12:11 AM
Daniel Cooper
Daniel Cooper - avatar
2 Answers
+ 5
txt.match(/[^a-z0-9]/gi)
27th Aug 2018, 12:36 AM
Calviղ
Calviղ - avatar
0
Thanks Calviղ Regular Expressions are difficult to learn for me. Lol
27th Aug 2018, 2:14 AM
Daniel Cooper
Daniel Cooper - avatar