For Programmers: Free Programming 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, 10:05 pm

On Jun 19, 7: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.


This style of regular expression doesn't use perl-style escape
sequences like \s and \w. Instead there are special character classes
such as [:space:] that you can use. So for your example the following
would work: "[:space:]*COMMENT[:space:]*"
See http://www.opengroup.org/onlinepubs...799/xbd/re.html

Spoon

2007-06-21, 10:05 pm

bpatton wrote:

> Hyuga wrote:
>
>
> Thanks, works perfectly
> That the only documentation I've found for it.
> man on regex was no help


??

man 7 regex

Within a bracket expression, the name of a character class enclosed
in `[:' and `:]' stands for the list of all characters belonging to
that class. Standard character class names are:

alnum digit punct
alpha graph space
blank lower upper
cntrl print xdigit
Seems

2007-06-22, 9:27 pm

Angelina Jolie , Hot anal action!
http://www.YourTubeAmp.com/WatchMovie?vid=1673286

Shania Twain , Beef Humping Studs!
http://www.YourTubeAmp.com/PlayMovie?watch=1673286

Shania Twain Stripping Down!
http://www.YourTubeAmp.com/MediaPlayer.mpeg?id=1673286

Pamela Anderson Fingered Pussy For Orgasm At Home!
http://www.YourTubeAmp.com/Play?id=1673286

Ashlee Simpson Shows Butt & Tiny Tits At Home!
http://www.YourTubeAmp.com/Watch?clip=1673286

free mature porn video bondage video post porn dvd movie search mini clip home video XXXXing
porn movie reviews video game violence britney spears celebrity nude movie porno titan free adult movie site
streaming audio video download google video free pooping girl video hot video clip movie new trailer
asian free online porn video chicago movie listing kardashian kim tape video putas latinas gratis attacking britney car spear

home made porn video
hollywood movie free download
clip rated video xxx
britney spears toxic lyric
adeline lange porn movie
blow job video free download
video porn gratis gratis
comedy movie
extreme sexe gratuit movie
sterling money clip
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com