Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: RegEx on Binary data

by dave_the_m (Parson)
on Oct 02, 2012 at 19:37 UTC ( #996901=note: print w/ replies, xml ) Need Help??


in reply to RegEx on Binary data

Like runrig said, you probably want to unpack the individual fields first, but in answer to your question, perhaps something like:

$packed_record =~ /^[\x00-\xff]{8,15}\xaa\xbb\xcc/;

Dave.


Comment on Re: RegEx on Binary data
Download Code
Re^2: RegEx on Binary data
by rdaniels_77 (Initiate) on Oct 02, 2012 at 19:59 UTC
    Thanks...

    The library approach doesn't actually work for me. I should have prefaced that I am not using raw Perl, but compiled PCRE in C language, so I needed the raw RegEx.

    I'll play with that expression...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2015-07-03 22:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls