I'm new to regex, so I've done a bit research. My filter should only allow:
- a-Z
- 0-9 (meaning 0 to 9)
- ()
- []
I've found this regex:
"/^[a-zA-Z0-9]+$/"
I edited it to allow ()
"/^[a-zA-Z0-9()]+$/"
But how to make the regex allowing [] too? Seems like [] need to be escaped somehow.