Boost logo

Boost Users :

From: John Maddock (john_at_[hidden])
Date: 2006-07-28 08:06:13


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.


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net