How to escape a less-than ('<') character in a jcr:root element property
This is the code I have at /etc/map.prod.publish/https/mysite.net/content/.content.xml to redirect some matching URLs. I'm trying to use a regular expression with a backreference, but when I go to publish the changes, I get an error about the '<' character not being allowed in the sling:match property. How do I escape that character? "<" didn't work.
The code:
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0"
jcr:primaryType="sling:Mapping"
sling:match="^/*(?!$|(?:content|apps|etc|libs)/)(?:((?:(?=((?=([^/]+))\\3/+))\\2)*)([^/]+)(?<!\\.html)(?:(\\.html)|/+))$"
sling:redirect="[/$1$4]"
sling:status="302"
/>
The error message:
03.03.2022 18:25:11.369 *ERROR* [qtp1433131481-1750] org.apache.jackrabbit.vault.fs.io.Importer E /etc/map.prod.publish/https/mysite.net/content (org.xml.sax.SAXParseException; systemId: file:///C:/AEM/mysite.net/author/jcr_root/etc/map.prod.publish/https/mysite.net/content/.content.xml; lineNumber: 5; columnNumber: 99; The value of attribute "sling:match" associated with an element type "jcr:root" must not contain the '<' character.)