
awebb
New User
Aug 23, 2007, 2:20 PM
Post #3 of 3
(1282 views)
|
|
Re: [KevinR] help with substitution of unclosed html tags
[In reply to]
|
Can't Post
|
|
Thanks for your help Kevin, but I managed to fix the problem last night shortly after posting this forum topic. It turns out that the .* was greedy like you said. I fixed the problem with the regex below if anybody ever runs into the same kind of problem.
my $count = 1; $count++ while ($html =~ s{[ \t]*<li>([^<>]+)(?= <li>|</ul>)}{$count\. $1\n}i); I have not tried your approach yet but it may be more efficient. It looks to me like it should work. In fact I think I like the way you accomplished the task better than mine.
(This post was edited by awebb on Aug 23, 2007, 2:27 PM)
|