Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
How to search for the string where (p class=) and if before the string if character '<' doesnot exists should be replaced with <. The output should be#!/usr/bin/perl while(<DATA>){ s/p\sclass=/\<p\\sclass=/g; print $_; } __DATA__ p class="Hi"> <p class="new">
<p class="Hi"> <p class="new">
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: replace at the begining
by ashish.kvarma (Monk) on Aug 20, 2009 at 12:37 UTC | |
by Anonymous Monk on Aug 20, 2009 at 15:37 UTC | |
Re: replace at the begining
by Melly (Chaplain) on Aug 20, 2009 at 10:48 UTC | |
by $self (Friar) on Aug 20, 2009 at 11:39 UTC | |
by Taulmarill (Deacon) on Aug 20, 2009 at 11:32 UTC | |
by Anonymous Monk on Aug 20, 2009 at 11:07 UTC | |
by Melly (Chaplain) on Aug 20, 2009 at 11:37 UTC | |
Re: replace at the begining
by sanku (Beadle) on Aug 21, 2009 at 10:02 UTC |