Skip to content

Commit 33b010b

Browse files
committed
fix: f-string expression part cannot include a backslash
1 parent d2deb96 commit 33b010b

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/xulbux/regex.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,10 @@ def func_call(func_name: Optional[str] = None) -> str:
104104
If no `func_name` is given, it will match any function call.\n
105105
---------------------------------------------------------------------------------
106106
Attention: Requires non-standard library `regex`, not standard library `re`!"""
107-
return rf"""(?<=\b)({func_name or r"[\w_]+"})\s*{Regex.brackets("(", ")", is_group=True)}"""
107+
if func_name in {"", None}:
108+
func_name = r"[\w_]+"
109+
110+
return rf"""(?<=\b)({func_name})\s*{Regex.brackets("(", ")", is_group=True)}"""
108111

109112
@staticmethod
110113
def rgba_str(fix_sep: Optional[str] = ",", allow_alpha: bool = True) -> str:

0 commit comments

Comments
 (0)