Boost logo

Boost Users :

From: Aaron (yilu_at_[hidden])
Date: 2005-08-28 01:07:17


But I use [^\n]* instead, and this pattern works well in a vbs
script(redundant '\' is removed,of course)

"John Maddock" <john_at_[hidden]> $)ATZNDUBVPLa5=:

>>I want to make a program to grep all symbols in header file,like:
>>
>> #define CMD_BASE 0x10000000
>> #define CMD_GETFile (CMD_BASE + 0X00000001) /* Get a file from srv*/
>>
>> A singl symbole definition line will be extract to three parts:
>> 1. symbol itself
>> 2. the value of a symbol, it's a signed 32-bit value
>> 3. comments about the symbol
>>
>> I use the following pattern:
>> std::string ptn = "\\s*#define\\s+([^\\s]+)\\s+([^/]*)([^\r\n]*)";
>>
>> I hope this pattern could do what I want, but when I use grep to do
>> the parsing, I got from above two lines:
>
>And so you should: the newline is a valid space character, if you don't want
>to match newlines then use [[:blank:]]+ instead.
>
>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