Re: Regular Expressions

From: Justin Rogers (Justin_at_games4dotnet.com)
Date: 04/20/04


Date: Mon, 19 Apr 2004 20:09:36 -0700

You really should use balancing groups here. Check out www.regexlib.com and
you'll find some helpful expressions for working with HTML.

-- 
Justin Rogers
DigiTec Web Consultants, LLC.
Blog: http://weblogs.asp.net/justin_rogers
"Matt Berther" <mberther@hotmail.com> wrote in message
news:%23Wag6onJEHA.228@TK2MSFTNGP10.phx.gbl...
> Hello Collin,
>
> > I'm new to regular expressions and I'm having some trouble with the
> > following.  I'm trying to match the start and end tags of a particular
> > HTML tag set and all the text inbetween.
>
> <\w+>(.*)</\w+>
>
> This will store the contents of everything in between the tags in a group.
Keep in mind that this expression doesnt account for attributes that may be on
the tag.
>
> --
> Matt Berther
> http://www.mattberther.com


Relevant Pages

  • Re: Parsing Baseball Stats
    ... HTML parsing is one of those slippery slopes - or perhaps "tar babies" might ... But HTML tags expressions *do* nest - lists within lists, ... And for applications such as this, pyparsing ...
    (comp.lang.python)
  • Re: Clipping ALL Occurrences of a Regex in an HTML File?
    ... Regular expressions are really bad at analyzing complex, ... malformed data like HTML. ... Legit HTML can have the tar attributes in different order, ... These would all need separate expressions, ...
    (perl.beginners)
  • Re: My EL not worky
    ... Tom Anderson wrote: ... If i put EL expressions in them, they're treated like plain strings - not interpreted as expressions. ... the tags are in charge of interpreting the EL. ...
    (comp.lang.java.programmer)
  • Re: Aligning text in frames
    ... No offence intended, but it sounds like you need a basic HTML tutorial. ... these expressions are used as a sort of social smoothing oil. ... courses because of their shoulder to shoulder closeness in battle ...
    (alt.html)
  • Re: Need Help Please - which software is best going from Front Page 20
    ... FrontPage has been discontinued, ... is no actual upgrade, the term is for marketing purposes for pricing. ... grabbing the html code from Front Page. ... There are so many different versions of Expressions and now Expressions 2 ...
    (microsoft.public.frontpage.client)