Validating email and password is necessary part of creating the LogIn and SignUp page, it validates that user cannot enter wrong format of email and password which saves user’s time. Thankfully validating email and password is not a big deal if we are using regular expression (regex). According to wikipedia A regular expression is a sequence of characters that specifies a search pattern. Usually such patterns are used by string-searching algorithms for "find" or "find and replace" operations on strings, or for input validation. It is a technique developed in theoretical computer science and formal language theory. Why we use regular expression : Regular expressions are particularly useful for defining filters. Regular expressions contain a series of characters that define a pattern of text to be matched—to make a filter more specialized, or general. For example, the regular expression ^AL[.]* searches for all items beginning with AL. The filter condition EntityName Like ^..N[.]* filters for all devices which have an N as the third letter of their name, and EntityName Like [.]*G filters for all devices whose name ends with the letter G. In this video we will create a simple login page and validating it using the regular expression, if validation is successful then user will be redirected to new page, else error will be shown over the text field.
Related Articles : https://www.geeksforgeeks.org/how-to-validate-a-password-using-regular-expressions-in-android/