Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Regex: Add more info on matching Unicode Properties.
Show how to match not only the General Categories
but also the values of Unicode Properties.
  • Loading branch information
samcv committed Dec 17, 2016
1 parent 7bce2d1 commit 6a10cf7
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions doc/Language/regexes.pod6
Expand Up @@ -203,10 +203,17 @@ Predefined subrules:
The character classes so far are mostly for convenience; a more systematic
approach is the use of Unicode properties. They are called in the form C<<
<:property> >>, where C<property> can be a short or long Unicode property
name.
<:property> >>, where C<property> can be a short or long Unicode General
Category name. These use pair syntax.
The following list is stolen from the Perl 5
To match against a specific value for a Unicode Property:
"a".uniprop('Script') # Latin
"a" ~~ / <:Script<Latin>> /
"a".uniprop('Block') # Basic Latin
"a" ~~ / <:Block('Basic Latin') /
The following list of Unicode General Categories is stolen from the Perl 5
L<perlunicode|http://perldoc.perl.org/perlunicode.html> documentation:
=begin table
Expand Down

0 comments on commit 6a10cf7

Please sign in to comment.