I have a regular expression and I want to check this regular expression is valid or not(correct format).
I try to use this code as below to check but it run not good
var regExp = new RegExp();
regExp.compile("^[\d\-]{0,64}"); => check OK.
regExp.compile("[[\d\-]{0,64}"); => check Not Good.
How to check my regular expression is correct format or not? Please help me handle this case.
[to match it literally