79639760

Date: 2025-05-27 03:12:49
Score: 0.5
Natty:
Report link
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('\\', '\\\\')}")

Reasons:
  • Blacklisted phrase (0.5): How can I
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: Adios Gringo