| 1 |
=head1 NAME |
| 2 |
|
| 3 |
XML::LibXML::RegExp - XML::LibXML::RegExp - interface to libxml2 regular expressions |
| 4 |
|
| 5 |
=head1 SYNOPSIS |
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
use XML::LibXML; |
| 10 |
my $compiled_re = XML::LibXML::RegExp->new('[0-9]{5}(-[0-9]{4})?'); |
| 11 |
if ($compiled_re->isDeterministic()) { ... } |
| 12 |
if ($compiled_re->matches($string)) { ... } |
| 13 |
|
| 14 |
$compiled_re = XML::LibXML::RegExp->new( $regexp_str ); |
| 15 |
$bool = $compiled_re->matches($string); |
| 16 |
$bool = $compiled_re->isDeterministic(); |
| 17 |
|
| 18 |
=head1 DESCRIPTION |
| 19 |
|
| 20 |
This is a perl interface to libxml2's implementation of regular expressions, |
| 21 |
which are used e.g. for validation of XML Schema simple types (pattern facet). |
| 22 |
|
| 23 |
=over 4 |
| 24 |
|
| 25 |
=item new() |
| 26 |
|
| 27 |
$compiled_re = XML::LibXML::RegExp->new( $regexp_str ); |
| 28 |
|
| 29 |
The constructor takes a string containing a regular expression and returns a |
| 30 |
compiled regexp object. |
| 31 |
|
| 32 |
|
| 33 |
=item matches($string) |
| 34 |
|
| 35 |
$bool = $compiled_re->matches($string); |
| 36 |
|
| 37 |
Given a string value, returns a true value if the value is matched by the |
| 38 |
compiled regular expression. |
| 39 |
|
| 40 |
|
| 41 |
=item isDeterministic() |
| 42 |
|
| 43 |
$bool = $compiled_re->isDeterministic(); |
| 44 |
|
| 45 |
Returns a true value if the regular expression is deterministic; returns false |
| 46 |
otherwise. (See the definition of determinism in the XML spec (L<<<<<< http://www.w3.org/TR/REC-xml/#determinism >>>>>>)) |
| 47 |
|
| 48 |
|
| 49 |
|
| 50 |
=back |
| 51 |
|
| 52 |
=head1 AUTHORS |
| 53 |
|
| 54 |
Matt Sergeant, |
| 55 |
Christian Glahn, |
| 56 |
Petr Pajas |
| 57 |
|
| 58 |
|
| 59 |
=head1 VERSION |
| 60 |
|
| 61 |
2.0134 |
| 62 |
|
| 63 |
=head1 COPYRIGHT |
| 64 |
|
| 65 |
2001-2007, AxKit.com Ltd. |
| 66 |
|
| 67 |
2002-2006, Christian Glahn. |
| 68 |
|
| 69 |
2006-2009, Petr Pajas. |
| 70 |
|
| 71 |
=cut |
| 72 |
|
| 73 |
|
| 74 |
=head1 LICENSE |
| 75 |
|
| 76 |
This program is free software; you can redistribute it and/or modify it under |
| 77 |
the same terms as Perl itself. |
| 78 |
|