RegEx for Client-Side Validation of FileUpload

I'm trying to create a RegEx Validator that checks the file extension in the FileUpload input against a list of allowed extensions (which are user specified). The following is as far as I have got, but I'm struggling with the syntax of the backward slash (\[code\]\\[/code\]) that appears in the file path. Obviously the below is incorrect because it just escapes the (\[code\]]\[/code\]) which causes an error. I would be really grateful for any help here. There seems to be a lot of examples out there, but none seem to work when I try them.\[code\][a-zA-Z_-s0-9:\]+(.pdf|.PDF)$\[/code\]
 
Back
Top