Finding <a href> with RegExp 
Author Message
 Finding <a href> with RegExp


Quote:
> I'm having difficulty parsing an .html file for <a hrefs>. (This is my
> first attempt at regular expressions so it's likely I'm missing
> something terribly obvious.)

> So far, I have
>     oRegExp.Pattern = "<a[^>]+"
> which matches everything up to the closing ">" for the opening tag.

> I tried
>     oRegExp.Pattern = "<a[^>]+>"
> which makes sense to me, but it doesn't work.

> From here I'd like to be able to get the rest of the opening tag, the
> link text between the two tags, and the href attribute text from the
> opening tag.

> Thanks for any help.

Try:

"<a[^>]*>"

-Chad



Tue, 15 Apr 2003 01:54:58 GMT  
 Finding <a href> with RegExp

Your post solved my problem as well.  Thanks.


Quote:
> On Thu, 26 Oct 2000 12:54:58 -0500, "Chad Myers"

> >Try:

> >"<a[^>]*>"

> Thanks, Chad, but what it was was this (ugh):

> I was using Response.Write to write the matches collection to a web
> page. Well, obviously, a bunch of <a href=""> tags by themself result
> in a totally blank page. When i added a simple if/then to make sure
> the size of the collection was > 0, it dawned on me what i did. duh.

> Yeesh, wasted a couple hours on that one...

> Thanks for your help.

> Steve



Wed, 23 Apr 2003 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. --------<<<<<<MONEY>>>>>>--------- id 9543

2. <<<<<<<<ComboBox>>>>>>>>>>>>

3. HELP >>>>>>WIN API <<<<<<<<<<

4. help me out please!!!!<<<<<<<<<<<<<<<<<<<<<<<thanks>>>>>>>>>>>>>>>>>>>>>>>>

5. <><><>HELP<><><> PCMCIA Motorola Montana 33.6

6. <<<<HELP- OLE container Control>>>>>>>>>

7. VB5<->RDO2<->ODBC<->ORACLE Procedure Problem

8. <<<Cneck Box>>>

9. <<<Gif Files>>>

10. <<<CD ROM>>>

11. <<<Win32Api.TXT>>>

12. <<<NetWork Drv>>>

 

 
Powered by phpBB® Forum Software