The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.


XML::RegExp - Regular expressions for XML tokens


 use XML::RegExp;

 if ($my_name =~ /^$XML::RegExp::Name$/)
   # $my_name is a valid XML 'Name'


This package contains regular expressions for the following XML tokens: BaseChar, Ideographic, Letter, Digit, Extender, CombiningChar, NameChar, EntityRef, CharRef, Reference, Name, NmToken, and AttValue.

The definitions of these tokens were taken from the XML spec (Extensible Markup Language 1.0) at

Also contains the regular expressions for the following tokens from the XML Namespaces spec at NCNameChar, NCName, QName, Prefix and LocalPart.


Original Author is Enno Derksen <>

Please send bugs, comments and suggestions to T.J. Mather <>