Right now, I have this code:
string strURL = "aLogin.aspx?test=hello";
string strPattern = "(.*/)?Login.aspx(?.*)?";
bool bIsLoginPage = System.Text.RegularExpressions.Regex.IsMatch(strURL , strPattern, System.Text.RegularExpressions.RegexOptions.IgnoreCase);
I’m searching for the proper regexp pattern, and I am at a loss.
The pattern must fulfill these criteria
Login.aspx ==> True
lOgIn.AsPx ==> True
/Login.aspx ==> True
whatever/Login.aspx ==> True
whatever/lOgIn.aSpX ==> True
WhAtEverLogin.aspx ==> false
Login.aspxxxxxx ==> false
Login.aspx?xyz=abc&etc ==> true
Login.aspxxyz=abc&etc ==> false
Login.aspx&xyz=abc&etc ==> false
What do you think about this?
of course with ignorecase.