develooper Front page | perl.beginners | Postings from April 2012

Re: Regex again..

Thread Previous
From:
Uri Guttman
Date:
April 14, 2012 08:55
Subject:
Re: Regex again..
Message ID:
4F899DDF.40505@stemsystems.com
On 04/14/2012 11:42 AM, Zheng Du wrote:
> Hi Somu,
>
> Of course if can be done by using regex, but if there is a single line
> command can do the job, that's absolutely more efficient, and less bug.

actually it can't be done by a regex. consider the issue of comments. 
think about comments containing chars that break natural html nesting. a 
regex can't handle that. there are other cases as well. escaping is 
another issue. this is why there are html parsers that do the job well. 
no one does html parsing with one regex.

uri

Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About