
HaHaMan
New User
Aug 16, 2012, 9:26 AM
Post #1 of 7
(2703 views)
|
[SOLVED] 2 beginner questions
|
Can't Post
|
|
First of all, sorry for my english ;) I got two questions: 1) I have a variable which contains a hexadecimal number, for example: 3e5c4685da I want to print it as '3e 5c 46 85 da'. In other words, to use a space separator every two hexadecimal numbers. How can I do that? 2) I was trying to use Regular Expressions but I still get a null variable. I got a string like this: '%SystemDrive%\Documents and Settings\XXXXX' I want to save the 'XXXXX' in a variable, and I know that is always after the last backslash (\). I tried this:
$owner = %SystemDrive%\Documents and Settings\LocalService; $owner =~ tr/[\\.*$]//; But when I print it, $owner contains no data. Any solution? Thanks!!
(This post was edited by HaHaMan on Aug 16, 2012, 12:35 PM)
|