Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

How to write the regular expression for Square brackets?

807588Jul 7 2009 — edited Jul 7 2009
Hi,
I want regular expression for the [] ‘Square brackets’.
I have tried to insert in the below code but the expression not validate the [] square brackets.
If anyone knows please help me how to write the regular expression for ‘[]’ Square brackets.
private static final Pattern DESC_PATTERN = Pattern.compile("({1}[a-zA-Z])" +"([a-zA-Z0-9\\s.,_():}{/&#-]+)$");
Thanks
Raghav
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 4 2009
Added on Jul 7 2009
3 comments
220 views