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.