SyntaxFix
Write A Post
Hire A Developer
Questions
I had the same problem using regex with bash scripting. I used a 2-step solution using pipes with grep -o applying
'\[(.*?)\]'
first, then
'\b.*\b'
Obviously not as efficient at the other answers, but an alternative.