username = "Npasandarshana@gmail.com"
password = "S@pasan123"
According to above example, string pattern "pasan" contains in the username.
I want to check whether all password or part of password contains in username for form validating before registration
i used javascript search function as below
password.search(username) == '-1'
but It searches whole password string in the username and it is not accurate.
Can I use a regex pattern to check some scenario like above in javascript?