diff --git a/Furious/Qt/TextEditorTheme.py b/Furious/Qt/TextEditorTheme.py index 6f9ad6bf..72170069 100644 --- a/Furious/Qt/TextEditorTheme.py +++ b/Furious/Qt/TextEditorTheme.py @@ -194,31 +194,51 @@ class DraculaJSONSyntaxHighlighter(AppQSyntaxHighlighter): class DraculaLoggerSyntaxHighlighter(AppQSyntaxHighlighter): - # https://ihateregex.io/expr/ip/ """Apply application-themed network logger syntax highlighting.""" - IPV4_REGEX = ( - r'(\b25[0-5]|\b2[0-4][0-9]|\b[01]?[0-9][0-9]?)' - r'(\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}(?::\d{1,5})?\b' + + # Keep IPv4 strict enough to avoid highlighting malformed octets in logs. + _IPV4_OCTET_REGEX = r'(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])' + _IPV4_ADDRESS_REGEX = rf'(?:{_IPV4_OCTET_REGEX}\.){{3}}{_IPV4_OCTET_REGEX}' + IPV4_REGEX = rf'(?