Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Example below
Input -->Some Text <br> ABCD</br> Some Thing Else<--
Output-->SomeText<br> ABCD</br> Some Thing Else<--
I have written the following code to do the same
$excel_br="<br>"; $line ="Some Text <br> ABCD</br> Some Thing Else" $line =~ s/$excel_br /$excel_br /g ; 1 while ($line =~ s/($excel_br( )+)/$1 /g ) ;
I was wondering if the same is possible with a single regex without the while loop ?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Replace leading Spaces after a tag
by ikegami (Patriarch) on Oct 09, 2010 at 07:07 UTC | |
|
Re: Replace leading Spaces after a tag
by kcott (Archbishop) on Oct 09, 2010 at 07:12 UTC | |
|
Re: Replace leading Spaces after a tag
by ww (Archbishop) on Oct 09, 2010 at 11:31 UTC | |
|
Re: Replace leading Spaces after a tag
by Your Mother (Archbishop) on Oct 09, 2010 at 15:58 UTC |