You could even add some error checking as ASCII requires that our number be between 0-127
$str = "Only change valid codes 128 -42 33\n"; print $str; $str =~ s/([+-]?\d+)/ ($1 > 0 and $1 < 128) ? chr $1 : $1 /eg; print $str;
cheers
tachyon
s&&rsenoyhcatreve&&&s&n.+t&"$'$`$\"$\&"&ee&&y&srve&&d&&print
In reply to Re: Re: Regex converting Binary to ASCII
by tachyon
in thread Regex converting Binary to ASCII
by growlf
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |