I can’t find a regex that matches repeated letters. My problem is that I want to use regex to filter out spam-mails, for example, I want to use regex to detect “spam” and “viagra” in these strings :
“xxxSpAmyyy”,
“xxxSPAMyyy”,
“xxxvI a Gr AA yyy”,
“xxxV iiA gR a xxx”
Do You have any suggestions how I do that in a good way?
This ignores the case, and it takes them whether they are one next to another, or there are other characters in between them
If you know how many characters can be between the letters, you can enter
.{0,max_distance}instead of.{0,}UPDATE:
It works even for duplicates, as i have tried it:
This prints
Yes