0

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
  • 795
  • 2
  • 9
  • 34

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,808
  • 5
  • 32
  • 49