I have the following script in Python that checks how many lines in column A in my dataset contains more than 3 signs like "?" or "!":
doublesigns = dataset[dataset["columnA"].str.contains("\?{3}|\!{3}", na=False)]
Now I want to do the same for more than 3 letters in a row, so that I can check errors in spelling, like "helllo" instead of "hello". In the script below I have tried this for 4 letters in the alphabet:
doublesigns = dataset[dataset["columnA"].str.contains("\a?{3}|\b{3}|\c{3}|\d{3}", na=False)]
I get the following error:
error: bad escape \c at position 10
It looks like the error is occurring with certain letters, but not all of the letters. Does someone know what the right script is?