Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

[Solved] What are these hex character classes?

by three18ti (Scribe)
on Dec 08, 2013 at 00:11 UTC ( #1066166=perlquestion: print w/ replies, xml ) Need Help??
three18ti has asked for the wisdom of the Perl Monks concerning the following question:

Hello Monks

I'm looking at the Marpa docs, and the example for a "hash comment char" definition is:

<hash comment char> ~ [^\x{A}\x{B}\x{C}\x{D}\x{2028}\x{2029}]

What character classes are \x{A} \x{B} \x{C} \x{D}, and more importantly, where can I look them up? I'm fairly certain that \x{2028} is a newline and \x{2029} is a paragraph separator (not sure how that's different than a new line...) class.

Thanks!

Edit: You all rock! Thanks for the help!

Comment on [Solved] What are these hex character classes?
Download Code
Replies are listed 'Best First'.
Re: What are these hex character classes?
by Kenosis (Priest) on Dec 08, 2013 at 00:37 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.

Re: What are these hex character classes? (perlrebackslash)
by Anonymous Monk on Dec 08, 2013 at 00:55 UTC

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (7)
As of 2015-07-31 03:53 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 (274 votes), past polls