Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
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
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 making s'mores by the fire in the courtyard of the Monastery: (19)
As of 2014-12-18 13:56 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (52 votes), past polls