README

Intl::Regex::CharClass

This module aims to provide localized variants of built in character classes. It currently only supports the <alpha> class inside of grammars, but support for other classes and outside of grammars. The API is still experimental, so do not (yet) depend on it.

Use

It's as simple as importing the module and adding in the trait is localized.

use Intl::Regex::CharClass

grammar Word is localized('en') {
    token TOP { <alpha>+ }
}
Word.parse('party');  # party
Word.parse('piñata'); # [no match]

grammar Palabra is localized('es') {
    token TOP { <alpha>+ }
}
Palabra.parse('piñata'); # piñata
Palabra.parse('fête');   # [no match]

If you do not specify a language, it will by default localized to the system language as defined by User::Language. If for some reason that is not available or detectable, it will default to en (English).

Version history

  • v0.1.0First release with support for <alpha>

Intl::Regex::CharClass v0.1.0

A module providing localized character class support in regex

Authors

  • Matthew Stephen Stuckwisch

License

Artistic-2.0

Dependencies

Intl::LanguageTag:auth<zef:guifa>:ver<0.12.1+>Intl::UserLanguage:auth<zef:guifa>:ver<0.4.0+>Intl::CLDR:auth<zef:guifa>:ver<0.7.5+>

Test Dependencies

Provides

  • Intl::Regex::CharClass

Documentation

The Camelia image is copyright 2009 by Larry Wall. "Raku" is trademark of the Yet Another Society. All rights reserved.