I've two get methods in my WebAPI, which are:
CheckPassword(string Password, string regExp)
//to validate password pattern, takes password and the regular expression.CheckEmailValid(string Email, string regExp)
//to validate email pattern, takes email and its regular expression.
When I try to call a Get method in WebAPI by passing two strings(password, regExp) OR (email, regExp) using a console app, some of the character miss out from the string. But at the same time if I have the regular expression in my WebAPI and test, it works fine. So I miss few character somewhere between the application and the webAPI.
Original Regex string for Password
public const string passwordPattern = @"^(?=.*[0-9]+.*)(?=.*[a-zA-Z]+.*)[0-9a-zA-Z]{7,}$";
The string which I receive at WebAPI Method while debugging
{^(?=.*[0-9] .*)(?=.*[a-zA-Z] .*)[0-9a-zA-Z]{7,}$}
Here I'm missing out + symbol, thats why password validation fails all the time.
Original Regex string for Email
public const string emailPattern = @"\A(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)\Z";
The string which I receive at WebAPI Method while debugging
\\A(?:[a-z0-9!
Any help will be greatly appreciated.