1

I'm trying to do a regex that allows all upper&lower case letters, digits and special characters:

% ' ` ( ) -& . / @ * , ! © ® ™


My regex:

/^[A-Za-z0-9%'`()-&./@*,!©®™\s]*$/

However, it returns invalid regex. Please help.

hatched
  • 755
  • 2
  • 8
  • 28

1 Answers1

2

You just need to escape the dash and the slash

^[A-Za-z0-9%'`()\-&.\/@*,!©®™\s]*$

You can test your regex here

SCouto
  • 7,371
  • 4
  • 33
  • 47