#!/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",
]
|