I need to create a loop in VBscript for an ASP app that will take a user input and loop through takeing each word and acting on it.

BUT when the two words are joined by SQL logic words like AND, OR NOT etc in capitial take the word before it and the word after it and act on it.

ALSO if the user types quotes then these must be the content of these must be taken as one "word" and acted on.

Given the power of the server and the number of users I need to be as quick as possible so the code must also be efficient while still being easily read.

My problem is I suck at string manipulation in a large way.

Your help will be greatly apriciated.