Click here to Skip to main content
15,886,519 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

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
JavaScript
var regExp = new RegExp();
regExp.compile("^[\d\-]{0,64}");  => check OK.
regExp.compile("[[\d\-]{0,64}");  => check Not Good.

Please help me handle this case.

thanks in advance.
Posted
Updated 10-Nov-15 19:01pm
v2
Comments
George Jonsson 10-Nov-15 23:38pm    
Not sure I understand your question.
How do you intend to check the regular expression? With a regular expression?
Kenneth Haugland 11-Nov-15 1:01am    
you have a [ too many in the second expression.

1 solution

You should try this:
https://www.debuggex.com/[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900