Can anyone give me a Swift regex to identify consecutive characters in a string?
My regex is .*(.)\\1$
and this is not working. My code block is;
let regex = ".*(.)\\1$"
return NSPredicate(format: "SELF MATCHES %@", regex).evaluate(with: string)
Examples:
abc123abc -> should be valid
abc11qwe or aa12345 -> should not be valid because of
11
andaa
Thanks