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
Hyuga

2007-06-21, 1:25 pm

On Jun 21, 8:39 am, Geoff Clare <g...@clare.See-My-Signature.invalid>
wrote:
> bpatton wrote:
>
>
>
>
> 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 <netn...@gclare.org.uk>


Oops, my fault. I hadn't intended to rewrite his entire regular
expression--just meant to give an example of using character classes
in bracket expressions. Of course, I clearly forgot you still needed
the outer brackets as well. This is part of why I find PERL regular
expressions preferrable ;)

Hyuga

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com