Unix Programming - Re: regular expression help using regex.h in c program

This is Interesting: Free IT Magazines  
Home > Archive > Unix Programming > June 2007 > Re: regular expression help using regex.h in c program





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author Re: regular expression help using regex.h in c program
Geoff Clare

2007-06-21, 1:25 pm

bpatton wrote:

[vbcol=seagreen]
[vbcol=seagreen]
> Thanks, works perfectly


If you actually used "[:space:]*COMMENT[:space:]*" then the reason
it "worked" is because it is equivalent to just "COMMENT". The "*"
matches _zero_ or more repetitions. The "[:space:]" does not match
a whitespace character, it matches ':', 's', 'p', 'a', 'c' or 'e'.
To match a whitespace character you need "[[:space:]]".

The equivalent of your PERL RE is:

"^[[:space:]]*COMMENT[[:space:]]*=[[:space:]]*\""

--
Geoff Clare <netnews@gclare.org.uk>
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com