How do I match %5C 
Author Message
 How do I match %5C

Hello...

I am having a bit of trouble.  I am new to Perl so try not to singe my
hair here...

I've got a URL string saved in a variable $proxyURL
The string itself looks something like this:
\\realserver%5Cwestulsrv%5CENL_34355101.rm

I am trying to break this out into an array using the split function.
I am trying to isolate the real media file by itself, so I an trying
to split the string by either the "/" symbol or the "%5C" hex value,
which I believe translates to a "/" symbol.  I thought that splitting
with a \/ would do the trick, but it doesn't seem to notice the %5c,
and if I split by %5c or \%5c or \x5c then I fragment the filename if
it contains a 5, so I'm not doing that right either.

Here is what I am doing...

and I have tried this:

and about 1 bazillion other things, anyone like to lend a hand??

Thanks,
Troy



Sun, 16 May 2004 17:26:03 GMT  
 How do I match %5C

Troy> Hello...
Troy> I am having a bit of trouble.  I am new to Perl so try not to singe my
Troy> hair here...

Troy> I've got a URL string saved in a variable $proxyURL
Troy> The string itself looks something like this:
Troy> \\realserver%5Cwestulsrv%5CENL_34355101.rm

You should be looking at URI::Escape from the LWP distribution.
Read "perldoc perlmodinstall" for information on how to install
it if it's not already installed for you.

print "Just another Perl hacker,"

--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095

Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!



Sun, 16 May 2004 17:39:52 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Perl5 in IRIX 4.0.5c...help

2. Case Sensitive Problem doing Pattern Matching

3. can match $n times be done?

4. Penalties when doing case insensitive matching

5. Applying a regex on a line that matches several times and doing a lookup per match to a function?

6. Help with regex: How to match shortest match (Anno Siegel)

7. Help with regex: How to match shortest match

8. \([0-9]{3}\) matching but \b\([0-9]{3}\)\b is matching nothing,

9. matching matching quotes - efficiency wanted

10. match where 2 characters in a row don't match

11. Pattern bug matching whitespace in multi-line match?

12. String matching with matching delimiters

 

 
Powered by phpBB® Forum Software