XML::Li...::RegExp(3)
β¨ XML::LibXML::RegExp β¨
okay so bestie, welcome to XML::LibXML::RegExp π β it's your lil gateway to libxml2's very own regular expression engine. No cap, this is a Perl interface to libxml2's implementation of regexes, and you'll catch it doing the most for validation of XML Schema simple types (hi, pattern facet π). Periodt.
πΈ SYNOPSIS πΈ
use XML::LibXML;
my $compiled_re = XML::LibXML::RegExp->new('[0-9]{5}(-[0-9]{4})?');
if ($compiled_re->isDeterministic()) { ... }
if ($compiled_re->matches($string)) { ... }
$compiled_re = XML::LibXML::RegExp->new( $regexp_str );
$bool = $compiled_re->matches($string);
$bool = $compiled_re->isDeterministic();
π¦ DESCRIPTION π¦
So basically: this is a perl interface to libxml2's implementation of regular expressions. Those regexes get used, like, for validation of XML Schema simple types β specifically the pattern facet. It's giving β¨validator energyβ¨.
π new()
$compiled_re = XML::LibXML::RegExp->new( $regexp_str );
The constructor takes a string containing a regular expression and hands you back a compiled regexp object. Slay. You fed it a string, it feeds you a whole object. π
π matches($string)
$bool = $compiled_re->matches($string);
You give it a string value, and it returns a true value if that value is matched by the compiled regular expression. That's it, that's the whole vibe check. π«Ά
π isDeterministic()
$bool = $compiled_re->isDeterministic();
Returns a true value if the regular expression is deterministic; returns false otherwise. And if you're sitting there like "bestie what does deterministic even mean π" β the definition of determinism lives in the XML spec, right here: <http://www.w3.org/TR/REC-xml/#determinism> π
π AUTHORS π
Matt Sergeant, Christian Glahn, Petr Pajas β the iconique trio fr fr π
β VERSION β
2.0213
π COPYRIGHT π
2001-2007, AxKit.com Ltd.2002-2006, Christian Glahn.2006-2009, Petr Pajas.
π LICENSE π
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. iykyk πΈ
and that's the whole page bestie, you ate it up π no crumbs left, literally.
perl v5.42.2 Β· 2026-05-25 β mwah, go forth and compile some regexes π§β¨π
π¦ where this page comes from
- fedora 43: perl-XML-LibXML 1:2.0213-1.fc43 Β· (GPL-1.0-or-later OR Artistic-1.0-Perl) AND MIT
- fedora 44: perl-XML-LibXML 1:2.0213-1.fc44 Β· (GPL-1.0-or-later OR Artistic-1.0-Perl) AND MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms