I would like to display raw string of regex expression as it looks. I works with print but it does not work with ValueError. How can I display raw string of regex expression as it looks with ValueError?
Using Windows 10 and Python 3.13.3
Change this:
raise ValueError(f"pattern with ValueError ={pattern}")
To:
raise ValueError(f"pattern with ValueError = {pattern.replace('\\', '\\\\')}")