I'm currently writing a document which has a large amount of output from Cisco routers. I would like to highlight the hexadecimal numbers such as MAC addresses which are within this, without highlighting every a-f character in the rest of the output.
I have tried using listings' literate option, which is working well for numerals, but I cannot get it to differentiate hex from any other text.
Below is my current number highlighting code:
literate={%
*{0}{{{\color{brown}0}}}1 %
{1}{{{\color{brown}1}}}1 %
{2}{{{\color{brown}2}}}1 %
{3}{{{\color{brown}3}}}1 %
{4}{{{\color{brown}4}}}1 %
{5}{{{\color{brown}5}}}1 %
{6}{{{\color{brown}6}}}1 %
{7}{{{\color{brown}7}}}1 %
{8}{{{\color{brown}8}}}1 %
{9}{{{\color{brown}9}}}1}, %
For good measure, here is my language declaration for the cisco commands, because I couldn't find one online:
\lstdefinelanguage{cisco}{
keywords={Interface int, ip, no, end, line, login, router, network, version, hostname, shutdown, shut, sh, show},
keywordstyle=\color{blue}\bfseries,
ndkeywords={dhcp, pool, GigabitEthernet, g, address, addr, rip, console, con, aux, vty},
ndkeywordstyle=\color{darkgray}\bfseries,
identifierstyle=\color{black},
sensitive=false,
comment=[l]{!},
commentstyle=\color{purple}\ttfamily,
stringstyle=\color{red}\ttfamily,
}
Any help would be much appreciated.