Gossamer Forum
Home : General : Perl Programming :

regex for matching quotes

Quote Reply
regex for matching quotes
This is driving me nuts... Given a string such as:
Code:
"a phrase" 'don't say that''another phrase'

How might I split that into:
Code:
a phrase
don't say that
another phrase

Note the word "don't", and that I can't assume a space or any other delimiter between quotes or the use of only single quotes or only double quotes in the string.

I suppose using multiple input fields would be easier, but I'd prefer a single input field if posible.

The phrases need to be split up and formatted into double quoted style for phrase matching in a fulltext index search.

Philip
------------------
Limecat is not pleased.