|
Boost Users : |
From: John Maddock (john_at_[hidden])
Date: 2006-07-28 05:14:29
Winson Yung wrote:
>> Hi all, I am not sure this is an old topic or not, but I cannot seem
>> to find an answer for this. I have a table, because of the table
>> column width restriction, some of the line in a table row/field gets
>> wrapped around to second/third lines. Here is a simple illustrated
>> the issue:
>>
>> >>
>> As you can see the description txt gets break down into three lines.
>> If I write something like this "^sales and marketing (excludes
>> stock-based compensation of", it's not gonna capture the entire line
>> that ended with numbers. The exact location where the line gets
>> wrapped around is not known, so it's impossible to craft the regular
>> expression like this beforehand.
>>
>> 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,.]+)"
Which extracts the six numbers as six sub-expressions.
Does that help?
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