Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?

[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.


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}"'


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


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



        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?

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2015-11-27 19:08 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (731 votes), past polls