I want char only domain name expression for email,dont want allow digits and spl chars in domain name.
eg:
[email protected]
not like these
[email protected]
[email protected]
[email protected]
[email protected]
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Joginder BangerPosted Nov 15, 2014, 2:49 AM
try this link
https://dotnetfiddle.net/4wgpJQ
Azaad AbbasPosted Nov 18, 2014, 1:07 AM
can u plz some more expressions provide me,I tried from searching on google.
1)Phone
like
(country code)(10 dgits) eg:+919000000000
if miss country code then error message display 'plz provide country code' and othervise display 'invalid no'
2)Marks
like
0-100 digits can only enter..not above 100 like 101...200....
3)AcademicYear
like
yyyy-yyyy
4)Tax
5)Shift
6)fax
like
+(country code)-(area code)-(fax number)
for example: +1-212-9876543 and with error message,if miss '-' then show 'missing '-'', if missing '+' then show 'missing '+''.
at least cant find country code and area code?
if miss country code then display 'plz provide country code'
if miss area code then display 'plz provide area code'?
Dawood AbbasPosted Nov 17, 2014, 2:22 AM
Joginder BangerPosted Nov 17, 2014, 1:42 AM
Dawood AbbasPosted Nov 15, 2014, 2:39 AM
[email protected]
Joginder BangerPosted Nov 15, 2014, 2:33 AM
"^[a-zA-Z-]+@[a-zA-Z]+\.[a-zA-Z]{2,4}"
i enter only capital condition but you are enter the small letter also.
Dawood AbbasPosted Nov 15, 2014, 2:17 AM
below i attached that page.
Joginder BangerPosted Nov 15, 2014, 2:09 AM
https://dotnetfiddle.net/4wgpJQ
Dawood AbbasPosted Nov 15, 2014, 2:05 AM
not working for actual email [email protected]
Joginder BangerPosted Nov 15, 2014, 1:47 AM
public class program
{
public bool emailcheck(string emailid)
{
bool temp = false;
Regex reg = new Regex(@"^[A-Z-]+@[A-Z]+\.[A-Z]{2,4}$", RegexOptions.IgnoreCase);
if (reg.IsMatch(emailid))
temp = true;
return temp;
}
// empcode,empname,dob,dept,bloodgroup
public static void Main(string[] args)
{
program obj = new program();
Console.WriteLine( obj.emailcheck("[email protected]")); //true
Console.WriteLine(obj.emailcheck("[email protected]")); //false
Console.WriteLine(obj.emailcheck("[email protected]")); //false
Console.WriteLine(obj.emailcheck("jogi@g%mail.com")); false
Console.WriteLine(obj.emailcheck("[email protected]")); false
}
}
check online
https://dotnetfiddle.net/4wgpJQ