Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Re: Manipulating multiple matches

by Anonymous Monk
on Aug 15, 2002 at 07:09 UTC ( [id://190327]=note: print w/replies, xml ) Need Help??


in reply to Re: Manipulating multiple matches
in thread Manipulating multiple matches

Yes, that works well. However I need to manipulate them (such as you just did) and then replace the match with the newly manipulated part. So that each of the "&#\d\d\d\d\d" becomes chr(\d\d\d\d\d) in the string.

Replies are listed 'Best First'.
Re: Re: Re: Manipulating multiple matches
by DamnDirtyApe (Curate) on Aug 15, 2002 at 08:00 UTC
    $string =~ s{&#(\d{5})}{chr( $1 )}ge ;

    _______________
    DamnDirtyApe
    Those who know that they are profound strive for clarity. Those who
    would like to seem profound to the crowd strive for obscurity.
                --Friedrich Nietzsche
Re: Re: Re: Manipulating multiple matches
by physgreg (Scribe) on Aug 15, 2002 at 08:02 UTC
    Try this
    my $string = "&#15123 la di da &#32714 do bi do &#04271" ; $string =~ s/&#(\d\d\d\d\d)/chr($1)/ge ; print "$string\n"
    Hope that helps.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-16 19:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found