Boost logo

Boost :

From: perlmunger_at_[hidden]
Date: 2001-11-25 01:30:01


I've looked through the docs for Regex++ a bit to try to figure out
why it seems that my regex won't work unless I have both the caret(^)
at the beginning and the dollar ($) at the end of the expression or
it won't evaluate properly. I have yet to find anything that I
understand. What do I do if I want to just match part of the line.
For instance, my line is (BTW, in the actual program, I do properly
escape all of my quotes in the string and special chars in the
pattern itself):

<input type="text" name="address" value="111 Main St">

I would like to be able to just use the following regex:

name *= *\"?([^\" ]+)\"?

which would place the actual name 'address' in $1. I should, at this
point, have the match I need, however it fails to match unless I
provide the ^ and $ like this:

^.*name *= *\"?([^\" ]+)\"?.*>$

which is not necessarily ideal. I can explain further if need be.
What do I need to do to tell it to match just the middle of the line.
From the things I've read, this has something to do with POSIX
compliance (correct me if I'm wrong), but it's still unclear for me.
Any help would be appreciated.

I am building this on vc6 sp5

Thanks in advance for your help.

-Matt


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk