P
Pieter Online
Hello,
I'm trying to write a reverse-function with regex,
The following code gives: fedcba
$message = "abcdef";
$message =~ s/(.)(.)(.)(.)(.)(.)/$6$5$4$3$2$1/;
print $message;
But I like to use something like:
$message =~ s/(.){6}/$6$5$4$3$2$1/;
or even
$message =~ s/(.)*/$6$5$4$3$2$1/;
But that does not work, and all I can do is hope one of you can help me
out..
Thanks in advance,
Pieter
I'm trying to write a reverse-function with regex,
The following code gives: fedcba
$message = "abcdef";
$message =~ s/(.)(.)(.)(.)(.)(.)/$6$5$4$3$2$1/;
print $message;
But I like to use something like:
$message =~ s/(.){6}/$6$5$4$3$2$1/;
or even
$message =~ s/(.)*/$6$5$4$3$2$1/;
But that does not work, and all I can do is hope one of you can help me
out..
Thanks in advance,
Pieter