Can somebody create a regex for me that matches all special characters(Except white space)? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
+ 1

Can somebody create a regex for me that matches all special characters(Except white space)?

I need a javascript regex that matches all special characters. var specialcharacters = txt.match(//SpecialCharactersGoHere);

25th Aug 2018, 1:36 AM
Daniel Cooper
Daniel Cooper - avatar
3 ответов
+ 3
. Yeah that's the RegExp
25th Aug 2018, 1:59 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 2
Here, try this : txt.match("([^A-Za-z0-9]|\S)+");
25th Aug 2018, 3:26 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 1
txt.match(“[\W_]+”)
25th Aug 2018, 5:00 PM
krikkitbot
krikkitbot - avatar