How to check if a string contains three chars in consecutive order within a given string in any location? : <p>I am working on an app integration with a website. Basically, I am a PHP developer but the android app is using Java and I am not very professional in it. I need to offer an option to change passwords via the app itself.
When the user enters a new password as a string, I want the app to check and make sure that no three consecutive chars from the old password are repeated in the new password in the same order.</p>

<p>Eg. If a user has the old password "Angel173MN", he/she cannot opt for any new password that contains any three chars like nge,l17,73M etc (same order as in the old password, however, the same chars in other orders is permitted eg. gen, 7l1, 3M7 etc)</p>

<p>The upper/lower case is of no concern here. Can anyone please guide me how to do it?</p>
