Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Re: Hexadecimal character references not understood inside a regex

by Jim (Curate)
on May 28, 2013 at 20:45 UTC ( #1035720=note: print w/ replies, xml ) Need Help??


in reply to Hexadecimal character references not understood inside a regex

I'm dealing with a problem where hexadecimal character references such as '\x{FEFF}' and 'chr(0xFEFF)' are ignored when they appear inside a regex expression [sic].

If you're trying to match the Unicode byte order mark, then Perl must understand the text is Unicode and not in some other national or vendor coded character set. Does it? Show us more of your real code. I suspect your problem has less to do with hexadecimal escape sequences in regular expression patterns and more to do with decoding and encoding of input and output. Just a hunch…

There's also this idiom…

use charnames qw( :full ); m/\N{BYTE ORDER MARK}/;


Comment on Re: Hexadecimal character references not understood inside a regex
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2014-09-18 23:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (127 votes), past polls