
28 Jul
2006
28 Jul
'06
12:06 p.m.
John Maddock wrote:
Is there a way to write *ONE* regular expression to handle this?
Sure just separate the words with \\s+ to give something like:
"sales\\s+and\\s+marketing\\s+\\(\\s*excludes\\s+" "stock-based\\s+compensation\\s+of\\s+\\$(\\d+)" ",\\s+\\$(\\d+)\\s+and\\s+\\$(\\d+).+RESPECTIVELY\\)" "([\\d,.]+)\\s+([\\d,.]+)\\s+([\\d,.]+)"
There's a bug in that expression: I got tired of typing out all yout expected text and inserted a .* in there. That would have to be made non-greedy or else removed and replaced with the words you're expecting separating by more \\s+ separators. John.