I am comparing two strings but **excluding** the punctuation marks in both.

Here is my code snippet:

```
punctuation = r"[.?!,;:-']"
string1 = re.sub(punctuation, r"", string1)
string2 = re.sub(punctuation, r"", string2)

```

After running this code I get following exception

```none
bad character range :-' at position 6

```

How to get rid of this exception? What's the meaning of "bad character range"?