Regexp::CharClasses::Helper - User defined character class strings by unicode name or literals
use Regexp::CharClasses::Helper;
sub IsAorPlus {
return Regexp::CharClasses::Helper::fmt(
'A',
'LATIN SMALL LETTER A'
'+',
);
}
say 'matches' if 'A+' =~ /^\p{IsAorPlus}+$/;
sub InCapitalsButNot42 {
return Regexp::CharClasses::Helper::fmt(
"+A\tZ", # from A till Z
"-\x42" # except \x42
);
}
say "doesn't" if 'ABC' =~ /\p{InCapitalsButNot42}+/;
- fmt()
-
Takes in a list and turns it into the format specified by User-Defined Character Properties
http://github.com/athreef/Regexp-CharClasses-Helper
Regexp::CharClasses for a collection of user supplied character classes. Sub::CharacterProperties generates the subs themselves, but isn't usable at compile time.
User-Defined Character Properties perldoc.
Ahmad Fatoum <[email protected]>
, http://a3f.at
Copyright (C) 2016 Ahmad Fatoum
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.