|Just to complete things, I also wanted to pick up the other bit of text at the other end. That is, given:
yapyapyap ["fred"] moreyapyap I want to get the closing double quote through the closing square bracket whether there's white space between them or not. I did that using alternation as in this regular expression:
It probably doesn't teach anyone anything they don't know already but I thought it would be worth a mention if only to complete what I need to do.
If there is one thing more dangerous than getting between a bear and her cubs it's getting between my wife and her chocolate.