parse search string for phrases
Posted on 2006-11-12
I am taking input from a search HTML input field.
I need to parse, with regex if its faster, the string that input by the user to determine what items are phrases/keywords.
For instance if the user enters:
"big boats" trucks
I should somehow be able to know that "big boats" is a single phrase while "trucks" is its own keyword.
This needs to handle bad user input with an odd number of quotes or wrongly quoted values. Such as:
""big"boats" trucks" and so on...
Would be nice if we could omit words less than 3 letters in length also.