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 Abigail-II (Bishop) on Feb 02, 2004 at 17:16 UTC
    use Regexp::Common; /$RE{number}{hex}/;
    Abigail
Re: Matching long hex a strings
by borisz (Canon) on Feb 02, 2004 at 17:02 UTC
    Match the string  /([0-9a-f]{16})/i if it is 16 chars long.
    Boris