Can someone help me with a Javascript regular expression? I need to match pairs of brackets. For example, it should match “[abc123]”, “[123abc]” in the following string:
“this is a test [abc123]], another test [[123abc]. This is an left alone closing”
Thanks in advance.
If you don’t require nested brackets,
to extract the contents, see the following example: