Check a string for all or 3 consecutive characters of another string?
Regex python
Say I have string1 = "Helloworld33"
I want to be able to check a string2 so that it does not contain any three
character part of string1.
string2 could be any set of characters of any length.
For example:
string1 = "Helloworld33"
string2 = "ello" (invalid)
"3hi3" (valid)
"H e l l o" (valid)
"Hw3" (valid)
"I_^&_rld_37482" (invalid)
How can this be done through regex in python? Or is there a way to do it
without?
Much thanks
No comments:
Post a Comment