Link to home
Start Free TrialLog in
Avatar of Tapan Pattanaik
Tapan PattanaikFlag for India

asked on

Validate square bracket '[ & ]' in JavaScript (regular expression).

Hi team,

How to validate square bracket '[ and ]' in JavaScript (regular expression).

I have a textbox having value like this. So, I need a regular expression which will tell me square bracket is present in the textbox or not.

If there is a square bracket present in the textbox it will give me a error message.

[ABC  ESS080820183171][CTK  ESS080820189505][TROUS  ESS080820183485][SIMINESS  ESS080820184038][RAMMMM  ESS080820185998]
ASKER CERTIFIED SOLUTION
Avatar of leakim971
leakim971
Flag of Guadeloupe image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Tapan Pattanaik

ASKER

Will It handle for both the brackets (If any one of the brackets present in the text box it should tell me true or false)
1. [
2. ]
Thanks for your Help and for quick solution.
Will It handle for both the brackets (If any one of the brackets present in the text box it should tell me true or false)

yes 1 and 2
have a nice day