Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re^2: Using regexp with binary data

by fizbin (Chaplain)
on Aug 28, 2005 at 15:54 UTC ( [id://487270]=note: print w/replies, xml ) Need Help??


in reply to Re: Using regexp with binary data
in thread Using regexp with binary data

If you're using this as a general technique, you should also be very careful that your @find array doesn't contain any other special characters like "(", or "[". Just because you write characters as escape sequences doesn't give them any special status: they're just characters.
Ah, but if he takes my suggestion and writes each expression as qr"\x...blah blah..."s, then those escape sequences do in fact make the characters unspecial, and he can use this technique with impunity. For example, to his original code add the expressions qr"\x06\x2E"s and "\x06\x2E" - the one inside qr will not match, since in it the \x2E is seen as a literal, whereas without qr you'll get the problem you're talking about. (For those of you without the ASCII table memorized, \x2E is .)

For full details, see perlop, especially the section "Gory details of parsing quoted constructs".

--
@/=map{[/./g]}qw/.h_nJ Xapou cets krht ele_ r_ra/; map{y/X_/\n /;print}map{pop@$_}@/for@/

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 22:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found