\[[0-9a-zA-Z _]*\]
The above regex will work for all the test cases you had mentioned in your question. You may also use ^ if you want your text to start with [.
Thanks, Tariq.
No comments:
Post a Comment