Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re^3: Balance Change

by MCS (Monk)
on Feb 08, 2006 at 19:30 UTC ( #528905=note: print w/ replies, xml ) Need Help??


in reply to Re^2: Balance Change
in thread Balance Change

Thanks for the help everyone, I've also found you can write it like this as well:

while ( <code goes here> ) {}

The important but being that there's nothing in the {}. This gives us the original one-liner broken up to this:

#!/usr/bin/perl my $string = 'abc abc abc \textit{abc abc} abc \textit{abc abc \textbf +{abc \textbf{abc abc} abc} abc} abc.'; while ($string =~ s/\\text(i|b)[tf]\{([^{}]*)\}/<$1>$2<\/$1>/g) {} print $string;

Or you could take out the {} and add a 0, X, or whatever in front of the while (...)


Comment on Re^3: Balance Change
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://528905]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chilling in the Monastery: (13)
As of 2014-07-23 06:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (135 votes), past polls