I would like to match these characters: [] () in a character class in a regex in javascript, how can I do that?
The solution in grep would be: (regex - brackets and parenthesis in character-class)
<script>
var text = "echo some text (some text in parenthesis) [some other in brackets]";
var patt = /[][()]/g
console.log(text.match(patt));
</script>
But this regex provides no match in JS