Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Quick Regex Question

by kilinrax (Deacon)
on Feb 08, 2001 at 00:11 UTC ( #57037=note: print w/replies, xml ) Need Help??

in reply to Quick Regex Question

Converting to a hex value is pretty easy:
perl -e '$_ = q(^%@|CaD5H); s/([^\w-])/sprintf qq(%lx), ord($1)/eg; pr +int'
Doing the reverse will be a lot more tricky, unless you add a character to the start of each hex replacement to mark it out as such.

Replies are listed 'Best First'.
Re: Re: Quick Regex Question
by Albannach (Monsignor) on Feb 08, 2001 at 01:01 UTC
    Well if you need to be able to reverse it, why not just convert the whole dang string to hex (like a really conservative version of uuencode), provided the filename won't get too long.

    I'd like to be able to assign to an luser

Log In?

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

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2022-05-28 09:36 GMT
Find Nodes?
    Voting Booth?
    Do you prefer to work remotely?

    Results (99 votes). Check out past polls.