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? pattern = r"\\d\{(\d+)\}" print(f"pattern with print ={pattern}") raise ValueError(f"pattern with ValueError ={pattern}") The followings are outputs. pattern with print =\\d\{(\d+)\} pattern with ValueError =\\\\d\\{(\\d+)\\}" Continue reading...