Link to home
Create AccountLog in
Avatar of rmmarsh
rmmarshFlag for United States of America

asked on

What's wrong with this Regex statement?

This is my data I am looking for:

            <font size="-2"><br/><br/>List Price: $27.95</font>

This is the statement I am using:
            r = new Regex(@"<font size=""-2""><br/><br/>List Price:");  //  look for list price
            m = r.Match(bookInfo, 0);
            if (m.Success)
            {


It is returning "false", for which I am unclear why... I need to use Regex so I can get the index of the start of the price field...

Can anyone please tell me why this is not working?
ASKER CERTIFIED SOLUTION
Avatar of ZachSmith
ZachSmith
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of rmmarsh

ASKER

Zach:  you have escaped everything!  I tried only escaping the slashes, and it still doesn't work...

Mamtha... that's the same exact thing I already have... am I (or you) missing something?
can u post the full code?
SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of rmmarsh

ASKER

Fernando:  Sorry, that didn't work either...  it appears to be the quotes that are giving me the problem...
The code I posted worked on my system please post the code you have used so I can have a look.
Avatar of rmmarsh

ASKER

Partial contents of BookInfo:

Published 1992, First Edition Edition</i></font>            <font size="-2"><br/><br/>List Price: $27.95</font>            <font size="-2"><br/>ISBN-10: 0-345-37744-3&nbsp

----------------------------------

Could this be a .NET problem?
Avatar of rmmarsh

ASKER

This is the code:

            r = new Regex(@"<font size=""-2""><br/><br/>List Price:");  //  look for list price
            m = r.Match(bookInfo, 0);
            if (m.Success)
            {
Avatar of rmmarsh

ASKER

I found the problem... I was looking at data different from what I was testing with... I apologize for my error... points to everyone...

Again, sorry...