Beefy Boxes and Bandwidth Generously Provided by pair Networks Frank
Syntactic Confectionery Delight
 
PerlMonks  

Matching long hex a strings

by gman (Friar)
on Feb 02, 2004 at 11:50 UTC ( [id://325906]=perlquestion: print w/replies, xml ) Need Help??

This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.

gman has asked for the wisdom of the Perl Monks concerning the following question:

Hello,

As my regex skills are greatly lacking and I could not find a suitable solution that got my brain to jump start on it own, I'm having trouble matching a hex number like 01940110d840fc48. It could be contained in strings like the following examples.

_I_I_012c0110d840cc67 [call_process_result] <<<<<<<<<<<<stop interpret +ator INFO: Main menu CED is 1 Time: 36683996 ConnID 012c0110d840cc67 _C_W_012c0110d840cc67 [get_option_aux] there is no any value for optio +n strategy0x1

What I have tried so far matches on all or nothing.
Thanks in advance for the help!

Edited, 2 Feb 2004, by footpad: Added <code> tags around sample data and XML-ified the HTML formatting. Also, corrected minor typos.

Many thanks to borisz and Abigail for the quick response and solutions.

Thanks!

Replies are listed 'Best First'.
Re: Matching long hex a strings
by borisz (Canon) on Feb 02, 2004 at 12:02 UTC
    Match the string  /([0-9a-f]{16})/i if it is 16 chars long.
    Boris
Re: Matching long hex a strings
by Abigail-II (Bishop) on Feb 02, 2004 at 12:16 UTC
    use Regexp::Common; /$RE{number}{hex}/;
    Abigail

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://325906]
Approved by footpad
help
Sections?
Information?
Find Nodes?
Leftovers?
    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.