You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Perhaps there's a reason there isn't a \b in the regex already. My impression is that all valid hexadecimal numbers would have a space before the "0x".
Here's my monkey patch to work around it:
Monkey patch the highlighter pattern to not highlight "0x1080" in 1920x1080 as a hex number
from rich.highlighter import ReprHighlighter
for i, regex in enumerate(ReprHighlighter.highlights):
if '0x' in regex:
parts = regex.split('0x')
ReprHighlighter.highlights[i] = r'\b0x'.join(parts)