i want a regular expression to validate string to have only text,operators and these brackets ([ ])
i want a regular expression to validate string to have only text,operators and these
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
To match these characters:
A better version is:
Supporting parentheses is difficult because if you can put expressions in parentheses it is no longer a regular language (it is a context-free language). Regexes are a poor fit for matching that kind of expression. For that you’ll need a PDA (pushdown automaton).