Currently working on a JavaScript project where I am in need of extracting words enclosed within two brackets.
For example:
[Green]- Amazon
I specifically require the word "Green" from within the brackets. Using indexOf() won't work as there could be other colors like [red]
, [blue]
, etc. I'm struggling to find a way to extract characters exactly between the two brackets.
Wondering if anyone can provide assistance?