Normally I do good with RegExp, but this time I'm kinda stucked.
I'll use the pipe (|) as begin/end delimiter.
User enters a string like
boss wants that string to be transformed into
Basically create ONE ( and only one regexp) that finds any whitespace outside the double quotes and transform it into an " AND " (space_AND_space).
I say it has to be done in a couple of lines of code, boss says there's got to be a way to do it in one regexp without too much effort. I disagree.
If anybody out there could create this magical regexp please post it here...
THanks!!!
grtfercho çB^]\..
"Imagination is more important than Knowledge" A. Einstein
-----------------------------------------------
I'll use the pipe (|) as begin/end delimiter.
User enters a string like
Code:
|"google search" syntax verity|
boss wants that string to be transformed into
Code:
|"google search" AND syntax AND verity|
Basically create ONE ( and only one regexp) that finds any whitespace outside the double quotes and transform it into an " AND " (space_AND_space).
I say it has to be done in a couple of lines of code, boss says there's got to be a way to do it in one regexp without too much effort. I disagree.
If anybody out there could create this magical regexp please post it here...
THanks!!!
grtfercho çB^]\..
"Imagination is more important than Knowledge" A. Einstein
-----------------------------------------------