First of all, note that JavaScript has a regular expression type, so regular expressions can be specified as a language element do not need to be specified as a string, which does save you a couple of escape sequences and also your syntax highlighting can help you better.
Then you are doing this_
"." + param + "$"
This will change your regular expression. The dot means that an additional character of any class is matched at the beginning. Hence a single character won't match at all, you'll need to characters to match and the second charachter must be of the class you specified. Then you also append the $ at the end. You also have that character in your original expression: '[a-zA-Z0-9@%#&()/+*$,._\\-]+$', so now you got it twice. However one of them is ignored, so while this is not helpful, it is no harm. Probably you meant to use "^" + param + "$", because that would mean "match from the beginning (^) to the end ($), but then you should not include these in both your variable expression and your function.
Then there is the issue of the []. You simply need to escape them in the regex. But you ALSO need to escape them for the string, and then you need to escape the regex escape sequence for the string. So quite a lot of escapes. Note also that this applies to the dash, but the problem with the dash is ignores as long as it is the last part of the [] sequence. So finally your regex needs to be "^[a-zA-Z0-9@%#&()/+*$,._\\-\\[\\]]+$". (The escape for the opening [ is optional)
However if you use a literal, then you can just write /^[a-zA-Z0-9@%#&()/+*$,._\-\[\]]+$/, which is less escape sequences. In total that would be the result:
$(function() { $.validator.addMethod("accept", function(value, element, param) { return param.test(value); }, 'Only English is allowed'); $( "#accountForm" ).validate({ rules: { my_input : { required: true, accept: /^[a-zA-Z0-9@%#&()/+*$,._\-\[\]]+$/ } } }); });
new RegExp("." + param + "$"))? You'll end up with.[a-zA-Z0-9@%#&()/+*$,._\\-]+$$as a regex. I removed the.and$in your example, added the^and it appears to be working. Check this.