|
Posted by ikeon on November 27, 2008, 1:30 pm
Please log in for more thread options > ikeon wrote:
>
> > I have a script that I convert xml tags to html. like "<" I convert to
> > "<" and so on.
> > after the conversion I need to capture the information inside the tag.
> > let take for example the string "<abcd>: which is equivalent to
> > "<abcd>".
> > I tried to capture the "abcd" which can be different from tag to tag
> > in the following way:
>
> > /\<\;([^\&\gt\;]*)/
>
> You probably want something like:
>
> /<(.*?)>/
>
> John
> --
> Perl isn't a toolbox, but a small machine shop where you
> can special-order certain sorts of tools at low cost and
> in short order. =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0--=
Larry Wall
The (?!string) didn't work for some reason but I have learned a lot
from "perldoc perlre" ;)
The solution was /<(.*?)>/ which is the simple one. I tried it
with only (.*) but it was "greedy".
Thanks John and Peter for your quick respone.
|