Regexp::MultiLanguage - Convert common regular expressions checks in to Perl, PHP, and JavaScript code.
Version 0.03
Given a set of regular expressions in a simple format, this module writes code for Perl, PHP, and JavaScript that uses those regular expressions.
use Regexp::MultiLanguage qw(Perl JavaScript PHP); my $snippet = <<'END'; number : integer || binary integer : /\d+/ binary : /0b[01]+/i END print "Perl: \n"; print Regexp::MultiLanguage->compile( $snippet, 'Perl', 'isa_' ); print "\nJavaScript: \n"; print Regexp::MultiLanguage->compile( $snippet, 'JavaScript', 'isa_' ); print "\nPHP: \n"; print Regexp::MultiLanguage->compile( $snippet, 'PHP', 'isa_' );
The format used is similar to Parse::RecDescent:
name : expr
where expr is a boolean expression where each term is either another name or a regular expression.
expr
name
Usage: Regexp::MultiLanguage->compile( $code, $language, [$function_prefix] );
For each name in the "FORMAT" in code, generates one function whose name is [$function_prefix]name. These functions will compile in the language specified (must be Perl, PHP, or JavaScript).
[$function_prefix]name
Perl
PHP
JavaScript
Robby Walker, robwalker@cpan.org
Please report any bugs or feature requests to bug-regexp-multilanguage at rt.cpan.org, or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Regexp-MultiLanguage. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.
bug-regexp-multilanguage at rt.cpan.org
You can find documentation for this module with the perldoc command.
perldoc Regexp::MultiLanguage
You can also look for information at:
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/Regexp-MultiLanguage
CPAN Ratings
http://cpanratings.perl.org/d/Regexp-MultiLanguage
RT: CPAN's request tracker
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Regexp-MultiLanguage
Search CPAN
http://search.cpan.org/dist/Regexp-MultiLanguage
The development of this module was supported by http://www.e-tutor.com.
This module was developed for use in REV - the multi-language validation solution.
Copyright 2006 Robby Walker, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install Regexp::MultiLanguage, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Regexp::MultiLanguage
CPAN shell
perl -MCPAN -e shell install Regexp::MultiLanguage
For more information on module installation, please visit the detailed CPAN module installation guide.