CharClass — A Perl Regular Expression Character Class Library

What's new?

An Atom feed for ChangeLog diffs is available.

  1. A new module for fullwidth/halfwidth character normalization is added.
  2. An Atom feed for commit logs is available.

Modules

Modules defining character classes:

Char::Class::Alphabet
Character classes for alphabetical letters.
Char::Class::Han
Han character (CJK ideograph) classes.
Char::Class::Hiragana
Hiragana classes.
Char::Class::JaInput
Character classes defined in JIS input method standards.
Char::Class::ISOIECTR10176
ISO/IEC TR 10176 character repertoires.
Char::Class::JISX0221
JIS X 0221 character collections.
Char::Class::JISX4051
JIS X 4051 character classes.
Char::Class::JISX4052
JIS X 4052 character classes.
Char::Class::Katakana
Katakana classes.
Char::Class::Kana
Kana (hiragana, katakana, and additions) classes.
Char::Class::RFC1815
RFC 1815 character sets.
Char::Class::UCS
UCS (ISO/IEC 10646) character collections.
Char::Class::XML
XML-related character classes such as InXML_NameStartChar10 (XML 1.0 name start characters) and InXMLNameChar (XML 1.1 name characters).

A module for normalization:

Char::Normalize::FullwidthHalfwidth (New in 2.0)
Normalization of ideographic space, fullwidth alphanumeric characters, and halfwidth Kakatana.

Install

  1. Download the tarball and extract it.
  2. perl Makefile.PL
  3. make
  4. make install

Alternatively, just putting all files in the directory lib into your directory for Perl modules should work as well. All Perl modules in this package are written in pure Perl.

Example

use Char::Class::XML qw/InXML_NameStartChar10 InXMLNameChar10/;

if ($name !~ /\A\p{InXML_NameStartChar10}\p{InXMLNameChar10}*\z/) {
  die "$0: $name: This is not an XML 1.0 Name";
}

Distribution

The development version is available in the CVS repository.

TODO

License

© 2003‐2008 わかば (Wakaba) <w@suika.fam.cx>

This library and the library generated by it is free software; you can redistribute them and/or modify them under the same terms as Perl itself.