We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
[REQUEST]Please consider adding MAC/OUI highlighting - similar to IP Address/URL highlighting 
**Add MAC-address oui highlighting**

It'd be a useful addition if Rich could consistently handle highlighting of the multiple mac-address/oui formats that exist

e.g.
000c.298c.500f
0:c:29:8c:50:f
00:0C:29:8C:50:0F
00-0C-29-8C-50-0F
00:0c:29:8c:50:0f


--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `rich/default_styles.py`
Content:
```
1 from typing import Dict
2 
3 from .style import Style
4 
5 DEFAULT_STYLES: Dict[str, Style] = {
6     "none": Style.null(),
7     "reset": Style(
8         color="default",
9         bgcolor="default",
10         dim=False,
11         bold=False,
12         italic=False,
13         underline=False,
14         blink=False,
15         blink2=False,
16         reverse=False,
17         conceal=False,
18         strike=False,
19     ),
20     "dim": Style(dim=True),
21     "bright": Style(dim=False),
22     "bold": Style(bold=True),
23     "strong": Style(bold=True),
24     "code": Style(reverse=True, bold=True),
25     "italic": Style(italic=True),
26     "emphasize": Style(italic=True),
27     "underline": Style(underline=True),
28     "blink": Style(blink=True),
29     "blink2": Style(blink2=True),
30     "reverse": Style(reverse=True),
31     "strike": Style(strike=True),
32     "black": Style(color="black"),
33     "red": Style(color="red"),
34     "green": Style(color="green"),
35     "yellow": Style(color="yellow"),
36     "magenta": Style(color="magenta"),
37     "cyan": Style(color="cyan"),
38     "white": Style(color="white"),
39     "inspect.attr": Style(color="yellow", italic=True),
40     "inspect.attr.dunder": Style(color="yellow", italic=True, dim=True),
41     "inspect.callable": Style(bold=True, color="red"),
42     "inspect.def": Style(italic=True, color="bright_cyan"),
43     "inspect.error": Style(bold=True, color="red"),
44     "inspect.equals": Style(),
45     "inspect.help": Style(color="cyan"),
46     "inspect.doc": Style(dim=True),
47     "logging.keyword": Style(bold=True, color="yellow"),
48     "logging.level.notset": Style(dim=True),
49     "logging.level.debug": Style(color="green"),
50     "logging.level.info": Style(color="blue"),
51     "logging.level.warning": Style(color="red"),
52     "logging.level.error": Style(color="red", bold=True),
53     "logging.level.critical": Style(color="red", bold=True, reverse=True),
54     "log.level": Style.null(),
55     "log.time": Style(color="cyan", dim=True),
56     "log.message": Style.null(),
57     "log.path": Style(dim=True),
58     "repr.error": Style(color="red", bold=True),
59     "repr.str": Style(color="green", italic=False, bold=False),
60     "repr.brace": Style(bold=True),
61     "repr.comma": Style(bold=True),
62     "repr.ipv4": Style(bold=True, color="bright_green"),
63     "repr.ipv6": Style(bold=True, color="bright_green"),
64     "repr.tag_start": Style(bold=True),
65     "repr.tag_name": Style(color="bright_magenta", bold=True),
66     "repr.tag_contents": Style(color="default"),
67     "repr.tag_end": Style(bold=True),
68     "repr.attrib_name": Style(color="yellow", italic=True),
69     "repr.attrib_equal": Style(bold=True),
70     "repr.attrib_value": Style(color="magenta", italic=False),
71     "repr.number": Style(color="blue", bold=True, italic=False),
72     "repr.bool_true": Style(color="bright_green", italic=True),
73     "repr.bool_false": Style(color="bright_red", italic=True),
74     "repr.none": Style(color="magenta", italic=True),
75     "repr.url": Style(underline=True, color="bright_blue", italic=False, bold=False),
76     "repr.uuid": Style(color="bright_yellow", bold=False),
77     "rule.line": Style(color="bright_green"),
78     "rule.text": Style.null(),
79     "prompt": Style.null(),
80     "prompt.choices": Style(color="magenta", bold=True),
81     "prompt.default": Style(color="cyan", bold=True),
82     "prompt.invalid": Style(color="red"),
83     "prompt.invalid.choice": Style(color="red"),
84     "pretty": Style.null(),
85     "scope.border": Style(color="blue"),
86     "scope.key": Style(color="yellow", italic=True),
87     "scope.key.special": Style(color="yellow", italic=True, dim=True),
88     "scope.equals": Style(color="red"),
89     "repr.path": Style(color="magenta"),
90     "repr.filename": Style(color="bright_magenta"),
91     "table.header": Style(bold=True),
92     "table.footer": Style(bold=True),
93     "table.cell": Style.null(),
94     "table.title": Style(italic=True),
95     "table.caption": Style(italic=True, dim=True),
96     "traceback.border.syntax_error": Style(color="bright_red"),
97     "traceback.border": Style(color="red"),
98     "traceback.text": Style.null(),
99     "traceback.title": Style(color="red", bold=True),
100     "traceback.exc_type": Style(color="bright_red", bold=True),
101     "traceback.exc_value": Style.null(),
102     "traceback.offset": Style(color="bright_red", bold=True),
103     "bar.back": Style(color="grey23"),
104     "bar.complete": Style(color="rgb(249,38,114)"),
105     "bar.finished": Style(color="rgb(114,156,31)"),
106     "bar.pulse": Style(color="rgb(249,38,114)"),
107     "progress.description": Style.null(),
108     "progress.filesize": Style(color="green"),
109     "progress.filesize.total": Style(color="green"),
110     "progress.download": Style(color="green"),
111     "progress.percentage": Style(color="magenta"),
112     "progress.remaining": Style(color="cyan"),
113     "progress.data.speed": Style(color="red"),
114 }
115 
116 MARKDOWN_STYLES = {
117     "markdown.paragraph": Style(),
118     "markdown.text": Style(),
119     "markdown.emph": Style(italic=True),
120     "markdown.strong": Style(bold=True),
121     "markdown.code": Style(bgcolor="black", color="bright_white"),
122     "markdown.code_block": Style(dim=True, color="cyan", bgcolor="black"),
123     "markdown.block_quote": Style(color="magenta"),
124     "markdown.list": Style(color="cyan"),
125     "markdown.item": Style(),
126     "markdown.item.bullet": Style(color="yellow", bold=True),
127     "markdown.item.number": Style(color="yellow", bold=True),
128     "markdown.hr": Style(color="yellow"),
129     "markdown.h1.border": Style(),
130     "markdown.h1": Style(bold=True),
131     "markdown.h2": Style(bold=True, underline=True),
132     "markdown.h3": Style(bold=True),
133     "markdown.h4": Style(bold=True, dim=True),
134     "markdown.h5": Style(underline=True),
135     "markdown.h6": Style(italic=True),
136     "markdown.h7": Style(italic=True, dim=True),
137     "markdown.link": Style(color="bright_blue"),
138     "markdown.link_url": Style(color="blue"),
139 }
140 
141 
142 DEFAULT_STYLES.update(MARKDOWN_STYLES)
143
```

Path: `rich/highlighter.py`
Content:
```
1 from abc import ABC, abstractmethod
2 from typing import List, Union
3 
4 from .text import Text
5 
6 
7 class Highlighter(ABC):
8     """Abstract base class for highlighters."""
9 
10     def __call__(self, text: Union[str, Text]) -> Text:
11         """Highlight a str or Text instance.
12 
13         Args:
14             text (Union[str, ~Text]): Text to highlight.
15 
16         Raises:
17             TypeError: If not called with text or str.
18 
19         Returns:
20             Text: A test instance with highlighting applied.
21         """
22         if isinstance(text, str):
23             highlight_text = Text(text)
24         elif isinstance(text, Text):
25             highlight_text = text.copy()
26         else:
27             raise TypeError(f"str or Text instance required, not {text!r}")
28         self.highlight(highlight_text)
29         return highlight_text
30 
31     @abstractmethod
32     def highlight(self, text: Text) -> None:
33         """Apply highlighting in place to text.
34 
35         Args:
36             text (~Text): A text object highlight.
37         """
38 
39 
40 class NullHighlighter(Highlighter):
41     """A highlighter object that doesn't highlight.
42 
43     May be used to disable highlighting entirely.
44 
45     """
46 
47     def highlight(self, text: Text) -> None:
48         """Nothing to do"""
49 
50 
51 class RegexHighlighter(Highlighter):
52     """Applies highlighting from a list of regular expressions."""
53 
54     highlights: List[str] = []
55     base_style: str = ""
56 
57     def highlight(self, text: Text) -> None:
58         """Highlight :class:`rich.text.Text` using regular expressions.
59 
60         Args:
61             text (~Text): Text to highlighted.
62 
63         """
64         highlight_regex = text.highlight_regex
65         for re_highlight in self.highlights:
66             highlight_regex(re_highlight, style_prefix=self.base_style)
67 
68 
69 class ReprHighlighter(RegexHighlighter):
70     """Highlights the text typically produced from ``__repr__`` methods."""
71 
72     base_style = "repr."
73     highlights = [
74         r"(?P<brace>[\{\[\(\)\]\}])",
75         r"(?P<tag_start>\<)(?P<tag_name>[\w\-\.\:]*)(?P<tag_contents>.*?)(?P<tag_end>\>)",
76         r"(?P<attrib_name>\w+?)=(?P<attrib_value>\"?[\w_]+\"?)?",
77         r"(?P<bool_true>True)|(?P<bool_false>False)|(?P<none>None)",
78         r"(?P<number>(?<!\w)\-?[0-9]+\.?[0-9]*(e[\-\+]?\d+?)?\b)",
79         r"(?P<number>0x[0-9a-f]*)",
80         r"(?P<path>\B(\/[\w\.\-\_\+]+)*\/)(?P<filename>[\w\.\-\_\+]*)?",
81         r"(?P<ipv4>[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})",
82         r"(?P<ipv6>([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4})",
83         r"(?<!\\)(?P<str>b?\'\'\'.*?(?<!\\)\'\'\'|b?\'.*?(?<!\\)\'|b?\"\"\".*?(?<!\\)\"\"\"|b?\".*?(?<!\\)\")",
84         r"(?P<url>https?:\/\/[0-9a-zA-Z\$\-\_\+\!`\(\)\,\.\?\/\;\:\&\=\%\#]*)",
85         r"(?P<uuid>[a-fA-F0-9]{8}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{12})",
86     ]
87 
88 
89 if __name__ == "__main__":  # pragma: no cover
90     from .console import Console
91 
92     console = Console()
93     console.print("[bold green]hello world![/bold green]")
94     console.print("'[bold green]hello world![/bold green]'")
95 
96     console.print(" /foo")
97     console.print("/foo/")
98     console.print("/foo/bar")
99     console.print("foo/bar/baz")
100 
101     console.print("/foo/bar/baz?foo=bar+egg&egg=baz")
102     console.print("/foo/bar/baz/")
103     console.print("/foo/bar/baz/egg")
104     console.print("/foo/bar/baz/egg.py")
105     console.print("/foo/bar/baz/egg.py word")
106     console.print(" /foo/bar/baz/egg.py word")
107     console.print("foo /foo/bar/baz/egg.py word")
108     console.print("foo /foo/bar/ba._++z/egg+.py word")
109     console.print("https://example.org?foo=bar#header")
110 
111     console.print(1234567.34)
112     console.print(1 / 2)
113     console.print(-1 / 123123123123)
114 
115     console.print(
116         "127.0.1.1 bar 192.168.1.4 2001:0db8:85a3:0000:0000:8a2e:0370:7334 foo"
117     )
118
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/rich/default_styles.py b/rich/default_styles.py
--- a/rich/default_styles.py
+++ b/rich/default_styles.py
@@ -61,6 +61,8 @@
     "repr.comma": Style(bold=True),
     "repr.ipv4": Style(bold=True, color="bright_green"),
     "repr.ipv6": Style(bold=True, color="bright_green"),
+    "repr.eui48": Style(bold=True, color="bright_green"),
+    "repr.eui64": Style(bold=True, color="bright_green"),
     "repr.tag_start": Style(bold=True),
     "repr.tag_name": Style(color="bright_magenta", bold=True),
     "repr.tag_contents": Style(color="default"),
diff --git a/rich/highlighter.py b/rich/highlighter.py
--- a/rich/highlighter.py
+++ b/rich/highlighter.py
@@ -80,6 +80,12 @@
         r"(?P<path>\B(\/[\w\.\-\_\+]+)*\/)(?P<filename>[\w\.\-\_\+]*)?",
         r"(?P<ipv4>[0-9]{1,3}\.[0-9]{1,3}\.[0-gt9]{1,3}\.[0-9]{1,3})",
         r"(?P<ipv6>([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4})",
+        r"(?P<eui48>([0-9A-Fa-f]{1,2}-){5}[0-9A-Fa-f]{1,2})",  # EUI-48 6x2 hyphen
+        r"(?P<eui64>([0-9A-Fa-f]{1,2}-){7}[0-9A-Fa-f]{1,2})",  # EUI-64 8x2 hyphen
+        r"(?P<eui48>([0-9A-Fa-f]{1,2}:){5}[0-9A-Fa-f]{1,2})",  # EUI-48 6x2 colon
+        r"(?P<eui64>([0-9A-Fa-f]{1,2}:){7}[0-9A-Fa-f]{1,2})",  # EUI-64 8x2 colon
+        r"(?P<eui48>([0-9A-Fa-f]{4}\.){2}[0-9A-Fa-f]{4})",  # EUI-48 3x4 dot
+        r"(?P<eui64>([0-9A-Fa-f]{4}\.){3}[0-9A-Fa-f]{4})",  # EUI-64 4x4 dot
         r"(?<!\\)(?P<str>b?\'\'\'.*?(?<!\\)\'\'\'|b?\'.*?(?<!\\)\'|b?\"\"\".*?(?<!\\)\"\"\"|b?\".*?(?<!\\)\")",
         r"(?P<url>https?:\/\/[0-9a-zA-Z\$\-\_\+\!`\(\)\,\.\?\/\;\:\&\=\%\#]*)",
         r"(?P<uuid>[a-fA-F0-9]{8}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{4}\-[a-fA-F0-9]{12})",

{"golden_diff": "diff --git a/rich/default_styles.py b/rich/default_styles.py\n--- a/rich/default_styles.py\n+++ b/rich/default_styles.py\n@@ -61,6 +61,8 @@\n     \"repr.comma\": Style(bold=True),\n     \"repr.ipv4\": Style(bold=True, color=\"bright_green\"),\n     \"repr.ipv6\": Style(bold=True, color=\"bright_green\"),\n+    \"repr.eui48\": Style(bold=True, color=\"bright_green\"),\n+    \"repr.eui64\": Style(bold=True, color=\"bright_green\"),\n     \"repr.tag_start\": Style(bold=True),\n     \"repr.tag_name\": Style(color=\"bright_magenta\", bold=True),\n     \"repr.tag_contents\": Style(color=\"default\"),\ndiff --git a/rich/highlighter.py b/rich/highlighter.py\n--- a/rich/highlighter.py\n+++ b/rich/highlighter.py\n@@ -80,6 +80,12 @@\n         r\"(?P<path>\\B(\\/[\\w\\.\\-\\_\\+]+)*\\/)(?P<filename>[\\w\\.\\-\\_\\+]*)?\",\n         r\"(?P<ipv4>[0-9]{1,3}\\.[0-9]{1,3}\\.[0-gt9]{1,3}\\.[0-9]{1,3})\",\n         r\"(?P<ipv6>([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4})\",\n+        r\"(?P<eui48>([0-9A-Fa-f]{1,2}-){5}[0-9A-Fa-f]{1,2})\",  # EUI-48 6x2 hyphen\n+        r\"(?P<eui64>([0-9A-Fa-f]{1,2}-){7}[0-9A-Fa-f]{1,2})\",  # EUI-64 8x2 hyphen\n+        r\"(?P<eui48>([0-9A-Fa-f]{1,2}:){5}[0-9A-Fa-f]{1,2})\",  # EUI-48 6x2 colon\n+        r\"(?P<eui64>([0-9A-Fa-f]{1,2}:){7}[0-9A-Fa-f]{1,2})\",  # EUI-64 8x2 colon\n+        r\"(?P<eui48>([0-9A-Fa-f]{4}\\.){2}[0-9A-Fa-f]{4})\",  # EUI-48 3x4 dot\n+        r\"(?P<eui64>([0-9A-Fa-f]{4}\\.){3}[0-9A-Fa-f]{4})\",  # EUI-64 4x4 dot\n         r\"(?<!\\\\)(?P<str>b?\\'\\'\\'.*?(?<!\\\\)\\'\\'\\'|b?\\'.*?(?<!\\\\)\\'|b?\\\"\\\"\\\".*?(?<!\\\\)\\\"\\\"\\\"|b?\\\".*?(?<!\\\\)\\\")\",\n         r\"(?P<url>https?:\\/\\/[0-9a-zA-Z\\$\\-\\_\\+\\!`\\(\\)\\,\\.\\?\\/\\;\\:\\&\\=\\%\\#]*)\",\n         r\"(?P<uuid>[a-fA-F0-9]{8}\\-[a-fA-F0-9]{4}\\-[a-fA-F0-9]{4}\\-[a-fA-F0-9]{4}\\-[a-fA-F0-9]{12})\",\n", "issue": "[REQUEST]Please consider adding MAC/OUI highlighting - similar to IP Address/URL highlighting \n**Add MAC-address oui highlighting**\r\n\r\nIt'd be a useful addition if Rich could consistently handle highlighting of the multiple mac-address/oui formats that exist\r\n\r\ne.g.\r\n000c.298c.500f\r\n0:c:29:8c:50:f\r\n00:0C:29:8C:50:0F\r\n00-0C-29-8C-50-0F\r\n00:0c:29:8c:50:0f\r\n\n", "before_files": [{"content": "from typing import Dict\n\nfrom .style import Style\n\nDEFAULT_STYLES: Dict[str, Style] = {\n    \"none\": Style.null(),\n    \"reset\": Style(\n        color=\"default\",\n        bgcolor=\"default\",\n        dim=False,\n        bold=False,\n        italic=False,\n        underline=False,\n        blink=False,\n        blink2=False,\n        reverse=False,\n        conceal=False,\n        strike=False,\n    ),\n    \"dim\": Style(dim=True),\n    \"bright\": Style(dim=False),\n    \"bold\": Style(bold=True),\n    \"strong\": Style(bold=True),\n    \"code\": Style(reverse=True, bold=True),\n    \"italic\": Style(italic=True),\n    \"emphasize\": Style(italic=True),\n    \"underline\": Style(underline=True),\n    \"blink\": Style(blink=True),\n    \"blink2\": Style(blink2=True),\n    \"reverse\": Style(reverse=True),\n    \"strike\": Style(strike=True),\n    \"black\": Style(color=\"black\"),\n    \"red\": Style(color=\"red\"),\n    \"green\": Style(color=\"green\"),\n    \"yellow\": Style(color=\"yellow\"),\n    \"magenta\": Style(color=\"magenta\"),\n    \"cyan\": Style(color=\"cyan\"),\n    \"white\": Style(color=\"white\"),\n    \"inspect.attr\": Style(color=\"yellow\", italic=True),\n    \"inspect.attr.dunder\": Style(color=\"yellow\", italic=True, dim=True),\n    \"inspect.callable\": Style(bold=True, color=\"red\"),\n    \"inspect.def\": Style(italic=True, color=\"bright_cyan\"),\n    \"inspect.error\": Style(bold=True, color=\"red\"),\n    \"inspect.equals\": Style(),\n    \"inspect.help\": Style(color=\"cyan\"),\n    \"inspect.doc\": Style(dim=True),\n    \"logging.keyword\": Style(bold=True, color=\"yellow\"),\n    \"logging.level.notset\": Style(dim=True),\n    \"logging.level.debug\": Style(color=\"green\"),\n    \"logging.level.info\": Style(color=\"blue\"),\n    \"logging.level.warning\": Style(color=\"red\"),\n    \"logging.level.error\": Style(color=\"red\", bold=True),\n    \"logging.level.critical\": Style(color=\"red\", bold=True, reverse=True),\n    \"log.level\": Style.null(),\n    \"log.time\": Style(color=\"cyan\", dim=True),\n    \"log.message\": Style.null(),\n    \"log.path\": Style(dim=True),\n    \"repr.error\": Style(color=\"red\", bold=True),\n    \"repr.str\": Style(color=\"green\", italic=False, bold=False),\n    \"repr.brace\": Style(bold=True),\n    \"repr.comma\": Style(bold=True),\n    \"repr.ipv4\": Style(bold=True, color=\"bright_green\"),\n    \"repr.ipv6\": Style(bold=True, color=\"bright_green\"),\n    \"repr.tag_start\": Style(bold=True),\n    \"repr.tag_name\": Style(color=\"bright_magenta\", bold=True),\n    \"repr.tag_contents\": Style(color=\"default\"),\n    \"repr.tag_end\": Style(bold=True),\n    \"repr.attrib_name\": Style(color=\"yellow\", italic=True),\n    \"repr.attrib_equal\": Style(bold=True),\n    \"repr.attrib_value\": Style(color=\"magenta\", italic=False),\n    \"repr.number\": Style(color=\"blue\", bold=True, italic=False),\n    \"repr.bool_true\": Style(color=\"bright_green\", italic=True),\n    \"repr.bool_false\": Style(color=\"bright_red\", italic=True),\n    \"repr.none\": Style(color=\"magenta\", italic=True),\n    \"repr.url\": Style(underline=True, color=\"bright_blue\", italic=False, bold=False),\n    \"repr.uuid\": Style(color=\"bright_yellow\", bold=False),\n    \"rule.line\": Style(color=\"bright_green\"),\n    \"rule.text\": Style.null(),\n    \"prompt\": Style.null(),\n    \"prompt.choices\": Style(color=\"magenta\", bold=True),\n    \"prompt.default\": Style(color=\"cyan\", bold=True),\n    \"prompt.invalid\": Style(color=\"red\"),\n    \"prompt.invalid.choice\": Style(color=\"red\"),\n    \"pretty\": Style.null(),\n    \"scope.border\": Style(color=\"blue\"),\n    \"scope.key\": Style(color=\"yellow\", italic=True),\n    \"scope.key.special\": Style(color=\"yellow\", italic=True, dim=True),\n    \"scope.equals\": Style(color=\"red\"),\n    \"repr.path\": Style(color=\"magenta\"),\n    \"repr.filename\": Style(color=\"bright_magenta\"),\n    \"table.header\": Style(bold=True),\n    \"table.footer\": Style(bold=True),\n    \"table.cell\": Style.null(),\n    \"table.title\": Style(italic=True),\n    \"table.caption\": Style(italic=True, dim=True),\n    \"traceback.border.syntax_error\": Style(color=\"bright_red\"),\n    \"traceback.border\": Style(color=\"red\"),\n    \"traceback.text\": Style.null(),\n    \"traceback.title\": Style(color=\"red\", bold=True),\n    \"traceback.exc_type\": Style(color=\"bright_red\", bold=True),\n    \"traceback.exc_value\": Style.null(),\n    \"traceback.offset\": Style(color=\"bright_red\", bold=True),\n    \"bar.back\": Style(color=\"grey23\"),\n    \"bar.complete\": Style(color=\"rgb(249,38,114)\"),\n    \"bar.finished\": Style(color=\"rgb(114,156,31)\"),\n    \"bar.pulse\": Style(color=\"rgb(249,38,114)\"),\n    \"progress.description\": Style.null(),\n    \"progress.filesize\": Style(color=\"green\"),\n    \"progress.filesize.total\": Style(color=\"green\"),\n    \"progress.download\": Style(color=\"green\"),\n    \"progress.percentage\": Style(color=\"magenta\"),\n    \"progress.remaining\": Style(color=\"cyan\"),\n    \"progress.data.speed\": Style(color=\"red\"),\n}\n\nMARKDOWN_STYLES = {\n    \"markdown.paragraph\": Style(),\n    \"markdown.text\": Style(),\n    \"markdown.emph\": Style(italic=True),\n    \"markdown.strong\": Style(bold=True),\n    \"markdown.code\": Style(bgcolor=\"black\", color=\"bright_white\"),\n    \"markdown.code_block\": Style(dim=True, color=\"cyan\", bgcolor=\"black\"),\n    \"markdown.block_quote\": Style(color=\"magenta\"),\n    \"markdown.list\": Style(color=\"cyan\"),\n    \"markdown.item\": Style(),\n    \"markdown.item.bullet\": Style(color=\"yellow\", bold=True),\n    \"markdown.item.number\": Style(color=\"yellow\", bold=True),\n    \"markdown.hr\": Style(color=\"yellow\"),\n    \"markdown.h1.border\": Style(),\n    \"markdown.h1\": Style(bold=True),\n    \"markdown.h2\": Style(bold=True, underline=True),\n    \"markdown.h3\": Style(bold=True),\n    \"markdown.h4\": Style(bold=True, dim=True),\n    \"markdown.h5\": Style(underline=True),\n    \"markdown.h6\": Style(italic=True),\n    \"markdown.h7\": Style(italic=True, dim=True),\n    \"markdown.link\": Style(color=\"bright_blue\"),\n    \"markdown.link_url\": Style(color=\"blue\"),\n}\n\n\nDEFAULT_STYLES.update(MARKDOWN_STYLES)\n", "path": "rich/default_styles.py"}, {"content": "from abc import ABC, abstractmethod\nfrom typing import List, Union\n\nfrom .text import Text\n\n\nclass Highlighter(ABC):\n    \"\"\"Abstract base class for highlighters.\"\"\"\n\n    def __call__(self, text: Union[str, Text]) -> Text:\n        \"\"\"Highlight a str or Text instance.\n\n        Args:\n            text (Union[str, ~Text]): Text to highlight.\n\n        Raises:\n            TypeError: If not called with text or str.\n\n        Returns:\n            Text: A test instance with highlighting applied.\n        \"\"\"\n        if isinstance(text, str):\n            highlight_text = Text(text)\n        elif isinstance(text, Text):\n            highlight_text = text.copy()\n        else:\n            raise TypeError(f\"str or Text instance required, not {text!r}\")\n        self.highlight(highlight_text)\n        return highlight_text\n\n    @abstractmethod\n    def highlight(self, text: Text) -> None:\n        \"\"\"Apply highlighting in place to text.\n\n        Args:\n            text (~Text): A text object highlight.\n        \"\"\"\n\n\nclass NullHighlighter(Highlighter):\n    \"\"\"A highlighter object that doesn't highlight.\n\n    May be used to disable highlighting entirely.\n\n    \"\"\"\n\n    def highlight(self, text: Text) -> None:\n        \"\"\"Nothing to do\"\"\"\n\n\nclass RegexHighlighter(Highlighter):\n    \"\"\"Applies highlighting from a list of regular expressions.\"\"\"\n\n    highlights: List[str] = []\n    base_style: str = \"\"\n\n    def highlight(self, text: Text) -> None:\n        \"\"\"Highlight :class:`rich.text.Text` using regular expressions.\n\n        Args:\n            text (~Text): Text to highlighted.\n\n        \"\"\"\n        highlight_regex = text.highlight_regex\n        for re_highlight in self.highlights:\n            highlight_regex(re_highlight, style_prefix=self.base_style)\n\n\nclass ReprHighlighter(RegexHighlighter):\n    \"\"\"Highlights the text typically produced from ``__repr__`` methods.\"\"\"\n\n    base_style = \"repr.\"\n    highlights = [\n        r\"(?P<brace>[\\{\\[\\(\\)\\]\\}])\",\n        r\"(?P<tag_start>\\<)(?P<tag_name>[\\w\\-\\.\\:]*)(?P<tag_contents>.*?)(?P<tag_end>\\>)\",\n        r\"(?P<attrib_name>\\w+?)=(?P<attrib_value>\\\"?[\\w_]+\\\"?)?\",\n        r\"(?P<bool_true>True)|(?P<bool_false>False)|(?P<none>None)\",\n        r\"(?P<number>(?<!\\w)\\-?[0-9]+\\.?[0-9]*(e[\\-\\+]?\\d+?)?\\b)\",\n        r\"(?P<number>0x[0-9a-f]*)\",\n        r\"(?P<path>\\B(\\/[\\w\\.\\-\\_\\+]+)*\\/)(?P<filename>[\\w\\.\\-\\_\\+]*)?\",\n        r\"(?P<ipv4>[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3})\",\n        r\"(?P<ipv6>([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4})\",\n        r\"(?<!\\\\)(?P<str>b?\\'\\'\\'.*?(?<!\\\\)\\'\\'\\'|b?\\'.*?(?<!\\\\)\\'|b?\\\"\\\"\\\".*?(?<!\\\\)\\\"\\\"\\\"|b?\\\".*?(?<!\\\\)\\\")\",\n        r\"(?P<url>https?:\\/\\/[0-9a-zA-Z\\$\\-\\_\\+\\!`\\(\\)\\,\\.\\?\\/\\;\\:\\&\\=\\%\\#]*)\",\n        r\"(?P<uuid>[a-fA-F0-9]{8}\\-[a-fA-F0-9]{4}\\-[a-fA-F0-9]{4}\\-[a-fA-F0-9]{4}\\-[a-fA-F0-9]{12})\",\n    ]\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    from .console import Console\n\n    console = Console()\n    console.print(\"[bold green]hello world![/bold green]\")\n    console.print(\"'[bold green]hello world![/bold green]'\")\n\n    console.print(\" /foo\")\n    console.print(\"/foo/\")\n    console.print(\"/foo/bar\")\n    console.print(\"foo/bar/baz\")\n\n    console.print(\"/foo/bar/baz?foo=bar+egg&egg=baz\")\n    console.print(\"/foo/bar/baz/\")\n    console.print(\"/foo/bar/baz/egg\")\n    console.print(\"/foo/bar/baz/egg.py\")\n    console.print(\"/foo/bar/baz/egg.py word\")\n    console.print(\" /foo/bar/baz/egg.py word\")\n    console.print(\"foo /foo/bar/baz/egg.py word\")\n    console.print(\"foo /foo/bar/ba._++z/egg+.py word\")\n    console.print(\"https://example.org?foo=bar#header\")\n\n    console.print(1234567.34)\n    console.print(1 / 2)\n    console.print(-1 / 123123123123)\n\n    console.print(\n        \"127.0.1.1 bar 192.168.1.4 2001:0db8:85a3:0000:0000:8a2e:0370:7334 foo\"\n    )\n", "path": "rich/highlighter.py"}], "after_files": [{"content": "from typing import Dict\n\nfrom .style import Style\n\nDEFAULT_STYLES: Dict[str, Style] = {\n    \"none\": Style.null(),\n    \"reset\": Style(\n        color=\"default\",\n        bgcolor=\"default\",\n        dim=False,\n        bold=False,\n        italic=False,\n        underline=False,\n        blink=False,\n        blink2=False,\n        reverse=False,\n        conceal=False,\n        strike=False,\n    ),\n    \"dim\": Style(dim=True),\n    \"bright\": Style(dim=False),\n    \"bold\": Style(bold=True),\n    \"strong\": Style(bold=True),\n    \"code\": Style(reverse=True, bold=True),\n    \"italic\": Style(italic=True),\n    \"emphasize\": Style(italic=True),\n    \"underline\": Style(underline=True),\n    \"blink\": Style(blink=True),\n    \"blink2\": Style(blink2=True),\n    \"reverse\": Style(reverse=True),\n    \"strike\": Style(strike=True),\n    \"black\": Style(color=\"black\"),\n    \"red\": Style(color=\"red\"),\n    \"green\": Style(color=\"green\"),\n    \"yellow\": Style(color=\"yellow\"),\n    \"magenta\": Style(color=\"magenta\"),\n    \"cyan\": Style(color=\"cyan\"),\n    \"white\": Style(color=\"white\"),\n    \"inspect.attr\": Style(color=\"yellow\", italic=True),\n    \"inspect.attr.dunder\": Style(color=\"yellow\", italic=True, dim=True),\n    \"inspect.callable\": Style(bold=True, color=\"red\"),\n    \"inspect.def\": Style(italic=True, color=\"bright_cyan\"),\n    \"inspect.error\": Style(bold=True, color=\"red\"),\n    \"inspect.equals\": Style(),\n    \"inspect.help\": Style(color=\"cyan\"),\n    \"inspect.doc\": Style(dim=True),\n    \"logging.keyword\": Style(bold=True, color=\"yellow\"),\n    \"logging.level.notset\": Style(dim=True),\n    \"logging.level.debug\": Style(color=\"green\"),\n    \"logging.level.info\": Style(color=\"blue\"),\n    \"logging.level.warning\": Style(color=\"red\"),\n    \"logging.level.error\": Style(color=\"red\", bold=True),\n    \"logging.level.critical\": Style(color=\"red\", bold=True, reverse=True),\n    \"log.level\": Style.null(),\n    \"log.time\": Style(color=\"cyan\", dim=True),\n    \"log.message\": Style.null(),\n    \"log.path\": Style(dim=True),\n    \"repr.error\": Style(color=\"red\", bold=True),\n    \"repr.str\": Style(color=\"green\", italic=False, bold=False),\n    \"repr.brace\": Style(bold=True),\n    \"repr.comma\": Style(bold=True),\n    \"repr.ipv4\": Style(bold=True, color=\"bright_green\"),\n    \"repr.ipv6\": Style(bold=True, color=\"bright_green\"),\n    \"repr.eui48\": Style(bold=True, color=\"bright_green\"),\n    \"repr.eui64\": Style(bold=True, color=\"bright_green\"),\n    \"repr.tag_start\": Style(bold=True),\n    \"repr.tag_name\": Style(color=\"bright_magenta\", bold=True),\n    \"repr.tag_contents\": Style(color=\"default\"),\n    \"repr.tag_end\": Style(bold=True),\n    \"repr.attrib_name\": Style(color=\"yellow\", italic=True),\n    \"repr.attrib_equal\": Style(bold=True),\n    \"repr.attrib_value\": Style(color=\"magenta\", italic=False),\n    \"repr.number\": Style(color=\"blue\", bold=True, italic=False),\n    \"repr.bool_true\": Style(color=\"bright_green\", italic=True),\n    \"repr.bool_false\": Style(color=\"bright_red\", italic=True),\n    \"repr.none\": Style(color=\"magenta\", italic=True),\n    \"repr.url\": Style(underline=True, color=\"bright_blue\", italic=False, bold=False),\n    \"repr.uuid\": Style(color=\"bright_yellow\", bold=False),\n    \"rule.line\": Style(color=\"bright_green\"),\n    \"rule.text\": Style.null(),\n    \"prompt\": Style.null(),\n    \"prompt.choices\": Style(color=\"magenta\", bold=True),\n    \"prompt.default\": Style(color=\"cyan\", bold=True),\n    \"prompt.invalid\": Style(color=\"red\"),\n    \"prompt.invalid.choice\": Style(color=\"red\"),\n    \"pretty\": Style.null(),\n    \"scope.border\": Style(color=\"blue\"),\n    \"scope.key\": Style(color=\"yellow\", italic=True),\n    \"scope.key.special\": Style(color=\"yellow\", italic=True, dim=True),\n    \"scope.equals\": Style(color=\"red\"),\n    \"repr.path\": Style(color=\"magenta\"),\n    \"repr.filename\": Style(color=\"bright_magenta\"),\n    \"table.header\": Style(bold=True),\n    \"table.footer\": Style(bold=True),\n    \"table.cell\": Style.null(),\n    \"table.title\": Style(italic=True),\n    \"table.caption\": Style(italic=True, dim=True),\n    \"traceback.border.syntax_error\": Style(color=\"bright_red\"),\n    \"traceback.border\": Style(color=\"red\"),\n    \"traceback.text\": Style.null(),\n    \"traceback.title\": Style(color=\"red\", bold=True),\n    \"traceback.exc_type\": Style(color=\"bright_red\", bold=True),\n    \"traceback.exc_value\": Style.null(),\n    \"traceback.offset\": Style(color=\"bright_red\", bold=True),\n    \"bar.back\": Style(color=\"grey23\"),\n    \"bar.complete\": Style(color=\"rgb(249,38,114)\"),\n    \"bar.finished\": Style(color=\"rgb(114,156,31)\"),\n    \"bar.pulse\": Style(color=\"rgb(249,38,114)\"),\n    \"progress.description\": Style.null(),\n    \"progress.filesize\": Style(color=\"green\"),\n    \"progress.filesize.total\": Style(color=\"green\"),\n    \"progress.download\": Style(color=\"green\"),\n    \"progress.percentage\": Style(color=\"magenta\"),\n    \"progress.remaining\": Style(color=\"cyan\"),\n    \"progress.data.speed\": Style(color=\"red\"),\n}\n\nMARKDOWN_STYLES = {\n    \"markdown.paragraph\": Style(),\n    \"markdown.text\": Style(),\n    \"markdown.emph\": Style(italic=True),\n    \"markdown.strong\": Style(bold=True),\n    \"markdown.code\": Style(bgcolor=\"black\", color=\"bright_white\"),\n    \"markdown.code_block\": Style(dim=True, color=\"cyan\", bgcolor=\"black\"),\n    \"markdown.block_quote\": Style(color=\"magenta\"),\n    \"markdown.list\": Style(color=\"cyan\"),\n    \"markdown.item\": Style(),\n    \"markdown.item.bullet\": Style(color=\"yellow\", bold=True),\n    \"markdown.item.number\": Style(color=\"yellow\", bold=True),\n    \"markdown.hr\": Style(color=\"yellow\"),\n    \"markdown.h1.border\": Style(),\n    \"markdown.h1\": Style(bold=True),\n    \"markdown.h2\": Style(bold=True, underline=True),\n    \"markdown.h3\": Style(bold=True),\n    \"markdown.h4\": Style(bold=True, dim=True),\n    \"markdown.h5\": Style(underline=True),\n    \"markdown.h6\": Style(italic=True),\n    \"markdown.h7\": Style(italic=True, dim=True),\n    \"markdown.link\": Style(color=\"bright_blue\"),\n    \"markdown.link_url\": Style(color=\"blue\"),\n}\n\n\nDEFAULT_STYLES.update(MARKDOWN_STYLES)\n", "path": "rich/default_styles.py"}, {"content": "from abc import ABC, abstractmethod\nfrom typing import List, Union\n\nfrom .text import Text\n\n\nclass Highlighter(ABC):\n    \"\"\"Abstract base class for highlighters.\"\"\"\n\n    def __call__(self, text: Union[str, Text]) -> Text:\n        \"\"\"Highlight a str or Text instance.\n\n        Args:\n            text (Union[str, ~Text]): Text to highlight.\n\n        Raises:\n            TypeError: If not called with text or str.\n\n        Returns:\n            Text: A test instance with highlighting applied.\n        \"\"\"\n        if isinstance(text, str):\n            highlight_text = Text(text)\n        elif isinstance(text, Text):\n            highlight_text = text.copy()\n        else:\n            raise TypeError(f\"str or Text instance required, not {text!r}\")\n        self.highlight(highlight_text)\n        return highlight_text\n\n    @abstractmethod\n    def highlight(self, text: Text) -> None:\n        \"\"\"Apply highlighting in place to text.\n\n        Args:\n            text (~Text): A text object highlight.\n        \"\"\"\n\n\nclass NullHighlighter(Highlighter):\n    \"\"\"A highlighter object that doesn't highlight.\n\n    May be used to disable highlighting entirely.\n\n    \"\"\"\n\n    def highlight(self, text: Text) -> None:\n        \"\"\"Nothing to do\"\"\"\n\n\nclass RegexHighlighter(Highlighter):\n    \"\"\"Applies highlighting from a list of regular expressions.\"\"\"\n\n    highlights: List[str] = []\n    base_style: str = \"\"\n\n    def highlight(self, text: Text) -> None:\n        \"\"\"Highlight :class:`rich.text.Text` using regular expressions.\n\n        Args:\n            text (~Text): Text to highlighted.\n\n        \"\"\"\n        highlight_regex = text.highlight_regex\n        for re_highlight in self.highlights:\n            highlight_regex(re_highlight, style_prefix=self.base_style)\n\n\nclass ReprHighlighter(RegexHighlighter):\n    \"\"\"Highlights the text typically produced from ``__repr__`` methods.\"\"\"\n\n    base_style = \"repr.\"\n    highlights = [\n        r\"(?P<brace>[\\{\\[\\(\\)\\]\\}])\",\n        r\"(?P<tag_start>\\<)(?P<tag_name>[\\w\\-\\.\\:]*)(?P<tag_contents>.*?)(?P<tag_end>\\>)\",\n        r\"(?P<attrib_name>\\w+?)=(?P<attrib_value>\\\"?[\\w_]+\\\"?)?\",\n        r\"(?P<bool_true>True)|(?P<bool_false>False)|(?P<none>None)\",\n        r\"(?P<number>(?<!\\w)\\-?[0-9]+\\.?[0-9]*(e[\\-\\+]?\\d+?)?\\b)\",\n        r\"(?P<number>0x[0-9a-f]*)\",\n        r\"(?P<path>\\B(\\/[\\w\\.\\-\\_\\+]+)*\\/)(?P<filename>[\\w\\.\\-\\_\\+]*)?\",\n        r\"(?P<ipv4>[0-9]{1,3}\\.[0-9]{1,3}\\.[0-gt9]{1,3}\\.[0-9]{1,3})\",\n        r\"(?P<ipv6>([A-Fa-f0-9]{1,4}::?){1,7}[A-Fa-f0-9]{1,4})\",\n        r\"(?P<eui48>([0-9A-Fa-f]{1,2}-){5}[0-9A-Fa-f]{1,2})\",  # EUI-48 6x2 hyphen\n        r\"(?P<eui64>([0-9A-Fa-f]{1,2}-){7}[0-9A-Fa-f]{1,2})\",  # EUI-64 8x2 hyphen\n        r\"(?P<eui48>([0-9A-Fa-f]{1,2}:){5}[0-9A-Fa-f]{1,2})\",  # EUI-48 6x2 colon\n        r\"(?P<eui64>([0-9A-Fa-f]{1,2}:){7}[0-9A-Fa-f]{1,2})\",  # EUI-64 8x2 colon\n        r\"(?P<eui48>([0-9A-Fa-f]{4}\\.){2}[0-9A-Fa-f]{4})\",  # EUI-48 3x4 dot\n        r\"(?P<eui64>([0-9A-Fa-f]{4}\\.){3}[0-9A-Fa-f]{4})\",  # EUI-64 4x4 dot\n        r\"(?<!\\\\)(?P<str>b?\\'\\'\\'.*?(?<!\\\\)\\'\\'\\'|b?\\'.*?(?<!\\\\)\\'|b?\\\"\\\"\\\".*?(?<!\\\\)\\\"\\\"\\\"|b?\\\".*?(?<!\\\\)\\\")\",\n        r\"(?P<url>https?:\\/\\/[0-9a-zA-Z\\$\\-\\_\\+\\!`\\(\\)\\,\\.\\?\\/\\;\\:\\&\\=\\%\\#]*)\",\n        r\"(?P<uuid>[a-fA-F0-9]{8}\\-[a-fA-F0-9]{4}\\-[a-fA-F0-9]{4}\\-[a-fA-F0-9]{4}\\-[a-fA-F0-9]{12})\",\n    ]\n\n\nif __name__ == \"__main__\":  # pragma: no cover\n    from .console import Console\n\n    console = Console()\n    console.print(\"[bold green]hello world![/bold green]\")\n    console.print(\"'[bold green]hello world![/bold green]'\")\n\n    console.print(\" /foo\")\n    console.print(\"/foo/\")\n    console.print(\"/foo/bar\")\n    console.print(\"foo/bar/baz\")\n\n    console.print(\"/foo/bar/baz?foo=bar+egg&egg=baz\")\n    console.print(\"/foo/bar/baz/\")\n    console.print(\"/foo/bar/baz/egg\")\n    console.print(\"/foo/bar/baz/egg.py\")\n    console.print(\"/foo/bar/baz/egg.py word\")\n    console.print(\" /foo/bar/baz/egg.py word\")\n    console.print(\"foo /foo/bar/baz/egg.py word\")\n    console.print(\"foo /foo/bar/ba._++z/egg+.py word\")\n    console.print(\"https://example.org?foo=bar#header\")\n\n    console.print(1234567.34)\n    console.print(1 / 2)\n    console.print(-1 / 123123123123)\n\n    console.print(\n        \"127.0.1.1 bar 192.168.1.4 2001:0db8:85a3:0000:0000:8a2e:0370:7334 foo\"\n    )\n", "path": "rich/highlighter.py"}]}