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}+/;
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 <athreef@cpan.org>, http://a3f.at
<athreef@cpan.org>
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.
To install Regexp::CharClasses::Helper, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Regexp::CharClasses::Helper
CPAN shell
perl -MCPAN -e shell install Regexp::CharClasses::Helper
For more information on module installation, please visit the detailed CPAN module installation guide.