tartrazine/lexers/dns.xml

45 lines
2.5 KiB
XML
Raw Normal View History

2024-08-02 20:03:49 +00:00
<?xml version="1.0"?>
<lexer>
<config>
<name>dns</name>
<alias>zone</alias>
<alias>bind</alias>
<filename>*.zone</filename>
<mime_type>text/dns</mime_type>
</config>
<rules>
<state name="root">
<rule pattern="\b(IN|A|AAAA|AFSDB|APL|CAA|CDNSKEY|CDS|CERT|CNAME|DHCID|DLV|DNAME|DNSKEY|DS|HIP|IPSECKEY|KEY|KX|LOC|MX|NAPTR|NS|NSEC|NSEC3|NSEC3PARAM|PTR|RRSIG|RP|SIG|SOA|SRV|SSHFP|TA|TKEY|TLSA|TSIG|TXT)\b">
<token type="Keyword"/>
</rule>
<rule pattern=";.*(\S|$)">
<token type="Comment"/>
</rule>
<rule pattern="\b((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d{2}|[1-9]?\d)){3}))|:)))\b">
<token type="LiteralNumberIntegerLong"/>
</rule>
<rule pattern="\b((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\b">
<token type="LiteralNumberInteger"/>
</rule>
<rule pattern="\b\d+[dhwm]?">
<token type="LiteralStringChar"/>
</rule>
<rule pattern="\b([\w\d.-])+\.($|\s)">
<token type="NameProperty"/>
</rule>
<rule pattern="([\w\d\.-]+\.[a-z-]{2,24}\.?|^(@|[\w\d-]+))">
<token type="NameClass"/>
</rule>
<rule pattern="^\$(TTL|GENERATE|INCLUDE|ORIGIN)">
<token type="NameAttribute"/>
</rule>
<rule pattern="\(|\)">
<token type="Punctuation"/>
</rule>
<rule pattern="[\r\n\s\t]+">
<token type="TextWhitespace"/>
</rule>
</state>
</rules>
</lexer>