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
bpatton

2007-06-19, 7:22 am

On Jun 19, 6:23 am, bpatton <bpat...@ti.com> wrote:
> I'm writing in c
> using regex.h
> on a PC.
> using gcc
> using cygwin.
> Here is my string I'm looking for :
> COMMENT = "2A3: ACTIVE perpendicular width where adjacent space is
> ACTIVE space >= 455 = 130"
>
> Here's where I'v compiled the regex.\ that works
> if (regcomp(&rex_comm,"\\s*COMMENT\\s*",REG_EXTENDED|REG_NOSUB|
> REG_ICASE) != 0) {
> ...
>
> }
>
> target PERL style regular expression : ^\\s*COMMENT\\s*=\\s*\"
>
> fails with : ^\\s*COMMENT\\s*
> fails with : \\s*COMMENT\\s*\\=
> fails with : \\s*COMMENT\\s*[=]
>
> I've tried using Regex Coach, but it deals with PERL class regexp and
> it works fine.


also need regex for empty line
in PERL it would be
^\s*$
Don't know about regex.h

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com