From: Wes Gamble Date: 2006-05-24T03:05:43+09:00 Subject: Regexp help: Matching HTML having trouble w/greediness All, I am attempting to do some matching on some HTML. Here's what I want: I want to be able to match any tag which is of the form that does NOT contain a "mailto:" href. The grouping is for some substitution that I'm doing. Here's my pattern: /()/mi What I find is that this pattern will successfully handle most area tags, however, when an area tag is followed by a tag (which also has a href attribute, it will match everything between tag). So, for example, this pattern matches all the way through the end of the tag. I tried to stick a negative lookahead (?!<) at the end of the pattern but that doesn't seem to help. How do I get this pattern to STOP matching? Thanks for any help, Wes -- Posted via http://www.ruby-forum.com/.