Regular Expression for [ ] square brackets

0
Hi I am trying to include a regular expression check a string value inputted by a user. Allowed characters are : “ £ $ € % & * ( ) – + [ ] A-Z a-z À-ÿ 0-9 Almost everything! Characters can appear in any form Currently in my decision I have : isMatch($Product/Description, '^[a-zA-ZÀ-ÿ0-9.\s&/()"%-+]*$\[\]\^\|]')   It fails when the description is: Chocolate [36 pk]   I have spent hours online trying to figure this out and no joy! Thank you in advance :)  
asked
1 answers
1

Update: Regex and link updated to handle € and £ as they were missing from the original answer

 

Give this a try

 

^[a-zA-ZÀ-ÿ0-9.\s&/()"%-+\[\]\*\$€£]*$

 

You can test it out using this link. It does escape a couple of characters such as “ and / .
https://regex101.com/r/liqy9j/2

I hope this helps.

answered