It won't correctly match:
<tag><tag></tag></tag>
Because of the lazy part, the first <tag> would match the first </
tag>, wich is incorrect. I think it should be greedy, so:
<TAG[^>]*>(.*)</TAG>
should work better.
Brian Cummiskey wrote:
>
> http://www.regular-expressions.info/regexbuddy/htmltagpair.html
>
> should do the trick
>
>
>
> Shadrik Easton wrote:
> >
> > Sorry about the off topic post but Im running out of options.
> >
> > quick question then: I need to use a regular expression to
extract some
> > text from between to tags. these tags being < description > and
> > < /description >
> >
> > for eg < description >This is some random text < /desription >
> >
> > I would need the 'This is some random text' part returned.. any
ideas?
> > thanks people and once again. sorry for the OT.
> >
> > Shad.
> >
> >
>