1XML::LibXML::RegExp(3)User Contributed Perl DocumentationXML::LibXML::RegExp(3)
2
3
4
6 XML::LibXML::RegExp - XML::LibXML::RegExp - interface to libxml2
7 regular expressions
8
10 use XML::LibXML;
11 my $compiled_re = new XML::LibXML::RegExp('[0-9]{5}(-[0-9]{4})?');
12 if ($compiled_re->isDeterministic()) { ... }
13 if ($compiled_re->matches($string)) { ... }
14
15 $compiled_re = XML::LibXML::RegExp->new( $regexp_str );
16 $bool = $compiled_re->matches($string);
17 $bool = $compiled_re->isDeterministic();
18
20 This is a perl interface to libxml2's implementation of regular
21 expressions, which are used e.g. for validation of XML Schema simple
22 types (pattern facet).
23
24 new()
25 $compiled_re = XML::LibXML::RegExp->new( $regexp_str );
26
27 The constructor takes a string containing a regular expression and
28 returns a compiled regexp object.
29
30 matches($string)
31 $bool = $compiled_re->matches($string);
32
33 Given a string value, returns a true value if the value is matched
34 by the compiled regular expression.
35
36 isDeterministic()
37 $bool = $compiled_re->isDeterministic();
38
39 Returns a true value if the regular expression is deterministic;
40 returns false otherwise. (See the definition of determinism in the
41 XML spec (http://www.w3.org/TR/REC-xml/#determinism
42 <http://www.w3.org/TR/REC-xml/#determinism>))
43
45 Matt Sergeant, Christian Glahn, Petr Pajas
46
48 1.70
49
51 2001-2007, AxKit.com Ltd.
52
53 2002-2006, Christian Glahn.
54
55 2006-2009, Petr Pajas.
56
57
58
59perl v5.12.0 2009-10-07 XML::LibXML::RegExp(3)