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

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

perlunicode#User Defined Character Properties

#!/usr/bin/perl -- use strict; use warnings; use Data::Dump; Main( @ARGV ); exit( 0 ); sub Main { my $wa = "'I' am with \x{2018}two\x{2018} kinds of quotes"; my $wi = $wa; my $subs = int $wi =~ s{\p{Punct}}{-}g ; dd [ 'Punct ', $subs, $wa, $wi ]; $wi = $wa; $subs = int $wi =~ s{\p{InPunctNoApostrophe}}{-}g ; dd ['InPunctNoApostrophe', $subs, $wa, $wi ]; } sub InPunctNoApostrophe { return join "\n", ,'+utf8::Punct' ## \p{Punct} aka General_Punctuation ,'-2018' ## LEFT SINGLE QUOTATION MARK (U+2018) ,'-2019' ## RIGHT SINGLE QUOTATION MARK (U+2019) ,'-201A' ## SINGLE LOW .'-9 QUOTATION MARK (U+201A) ,'-201B' ## SINGLE HIGH .'-REVERSED .'-9 QUOTATION MA +RK (U+201B) ,'-201C' ## LEFT DOUBLE QUOTATION MARK (U+201C) ,'-201D' ## RIGHT DOUBLE QUOTATION MARK (U+201D) ,'-201E' ## DOUBLE LOW .'-9 QUOTATION MARK (U+201E) ,'-201F' ## DOUBLE HIGH .'-REVERSED .'-9 QUOTATION MA +RK (U+201F) ,'-2039' ## SINGLE LEFT .'-POINTING ANGLE QUOTATION MARK + (U+2039) ,'-203A' ## SINGLE RIGHT .'-POINTING ANGLE QUOTATION MAR +K (U+203A) #~ ,'-0027' ## ascii https://en.wikipedia.org/wiki/Apostrop +he } __END__ [ "Punct ", 4, "'I' am with \x{2018}two\x{2018} kinds of quotes", "-I- am with -two- kinds of quotes", ] [ "InPunctNoApostrophe", 2, "'I' am with \x{2018}two\x{2018} kinds of quotes", "-I- am with \x{2018}two\x{2018} kinds of quotes", ]

In reply to Re: Exception from a character class (user defined character properties \p{IsUserDefined} sub IsUserDefined ) by Anonymous Monk
in thread Exception from a character class by pirkil

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others exploiting the Monastery: (8)
    As of 2014-09-17 08:39 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

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











      Results (68 votes), past polls