Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Reversing Arabic String direction

by LanX (Saint)
on Jul 10, 2014 at 22:41 UTC ( [id://1093149]=note: print w/replies, xml ) Need Help??


in reply to Re: Reversing Arabic String direction
in thread Reversing Arabic String direction

building on this, you'll need a second reverse and substitute numbers only

DB<136> $str ="a123bc45de" => "a123bc45de" DB<137> $str2= reverse $str => "ed54cb321a" DB<138> $str2 =~ s/(\p{N}+)/reverse $1/ge => 2 DB<139> $str2 => "ed45cb123a"

\p{N} is a guess, I'll check now¹! :)

update

changed order of inversion to make it clearer.

Cheers Rolf

(addicted to the Perl Programming Language)

¹) perlre only mentions \p{Digit} and \p{isDigit} ... both work for me.

Replies are listed 'Best First'.
Re^3: Reversing Arabic String direction
by Anonymous Monk on Jul 10, 2014 at 23:09 UTC
    Genius! ;)

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (3)
As of 2024-04-25 21:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found