Selenium Pattern Matching using Regular expressions
Selenium Regular Expression patterns are the most frequenty used and the most useful.
To test if a particular string contains our text, we can do so in the following manner.
let’s verify if an input field contains the string ‘Abhilash Gopi‘.
The input field is identified as strName
What does the value regexp indicate?
You will notice here that the regexp is given as [Aa]bhilash [Gg]opi
It means that the resultant text could be found as “abhilash gopi” or “Abhilash Gopi” or “Abhilash gopi” or “abhilash Gopi”, in whatever form it could be with either A and/ or G in uppercase or lowercase.
I hope you get this well.
Your typical regular expression for email verification would be given as
Another one would go like this
Regular expression to verify generic URL