Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Perl Monk, Perl Meditation
 
PerlMonks  

Re: What are these hex character classes?

by Kenosis (Priest)
on Dec 08, 2013 at 00:37 UTC ( #1066167=note: print w/ replies, xml ) Need Help??


in reply to [Solved] What are these hex character classes?

From Prelre:

\x{}, \x00 character whose ordinal is the given hexadecimal number

The \x denotes the beginning of a hexadecimal value.

Also see: Unicode character table.


Comment on Re: What are these hex character classes?
Select or Download Code
Re^2: What are these hex character classes?
by three18ti (Scribe) on Dec 08, 2013 at 01:35 UTC
    This is great. Thank you!

    So like most things in computing, the zeros are omitted, so \x{A} is actually \x{000A}.

      You're most welcome, three18ti!

      Perl expectedly parses both as "\n" (the leading zeros aren't significant):

      perl -MO=Deparse,-p -e 'print "\x{A}"'

      Output:

      print("\n"); -e syntax OK

      And:

      use warnings; use strict; print ord "\x{A}" if "\x{000A}" eq "\n";

      Output:

      10

      As you see, \x{A}, \x{000A} and \n all represent the same character.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (6)
As of 2014-04-20 05:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (485 votes), past polls