XML::RegExp(3)
π NAME π
okay so bestie, welcome to XML::RegExp β it's the perl module that hands you regular expressions for XML tokens. that's the whole vibe. it's giving "tiny module, big jobs." π
β¨ SYNOPSIS β¨
like, here's the entire use case and honestly it ate:
use XML::RegExp;
if ($my_name =~ /^$XML::RegExp::Name$/)
{
# $my_name is a valid XML 'Name'
}
that's it. that's the whole flex. you drop the variable in, it tells you if your string is a legit XML Name, no cap. π
πΈ DESCRIPTION πΈ
so this package is literally a little bag of regular expressions for these XML tokens, and yes i'm listing every single one because we do not skip items in this house:
BaseCharIdeographicLetterDigitExtenderCombiningCharNameCharEntityRefCharRefReferenceNameNmTokenAttValue
the definitions of all those tokens were taken from the XML spec (Extensible Markup Language 1.0) which lives at <http://www.w3.org/TR/REC-xml> β iconic source material fr fr. πβ¨
and it also contains regular expressions for these tokens from the XML Namespaces spec over at <http://www.w3.org/TR/REC-xml-names>:
NCNameCharNCNameQNamePrefixLocalPart
so you get two specs' worth of regex energy in one package. we love a two-for-one. π¦
π AUTHOR π
the Original Author is Enno Derksen <enno@att.com> β respect the originator, periodt. π«Ά
and please send bugs, comments and suggestions to T.J. Mather <tjmather@tjmather.com> β they're the main character handling all that, so be nice. π
ngl this page is a whole mood: short, sweet, and full of character classes.
okay bye bestie, go validate some XML πβ
β cute lil sign-off: this lovely page came from the User Contributed Perl Documentation, perl v5.42.0, dated 2012-05-31. ππ
π¦ where this page comes from
- opensuse-leap 16.0: perl-XML-RegExp 0.04-160000.2.2 Β· GPL-1.0+ or Artistic-1.0
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms