diff --git a/rich/text.py b/rich/text.py index fbff19ddf..b57d77c27 100644 --- a/rich/text.py +++ b/rich/text.py @@ -11,6 +11,7 @@ List, NamedTuple, Optional, + Pattern, Tuple, Union, ) @@ -591,7 +592,7 @@ def extend_style(self, spaces: int) -> None: def highlight_regex( self, - re_highlight: Union[re.Pattern[str], str], + re_highlight: Union[Pattern[str], str], style: Optional[Union[GetStyleCallable, StyleType]] = None, *, style_prefix: str = "",