تبلیغات
مرجع عملی و کاربردی زبان سی شارپ ، تصاویر دیدنی ، دانلود نرم افزار های گوناگون - کار کردن با انواع داده ها

کار کردن با انواع داده ها

نویسنده :مرتضی عالمین
تاریخ:یکشنبه 17 خرداد 1388-02:20 ب.ظ

6-عبارات منظم Regex:

اعتبار سنجی آدرسهای ایمیل به کمک عبارات منظم


کد:

using System.Text.RegularExpressions;

کد:

public bool TestEmailRegex(string emailAddress)

{

    string patternStrict = @"^(([^<>()[\]\\.,;:\s@\""]+"

          + @"(\.[^<>()[\]\\.,;:\s@\""]+)*)|(\"".+\""))@"

          + @"((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}"

          + @"\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+"

          + @"[a-zA-Z]{2,}))$";

    Regex reStrict = new Regex(patternStrict);

    bool isStrictMatch = reStrict.IsMatch(emailAddress);

    return isStrictMatch;

}

 




داغ کن - کلوب دات کام
نظرات() 
How can we increase our height?
جمعه 13 مرداد 1396 05:33 ب.ظ
I could not refrain from commenting. Very well written!
Foot Issues
شنبه 7 مرداد 1396 06:36 ب.ظ
Nice weblog here! Additionally your website loads up fast!
What web host are you using? Can I am getting your affiliate hyperlink on your
host? I want my website loaded up as fast as yours lol
BHW
سه شنبه 29 فروردین 1396 03:48 ب.ظ
Hello there! This article couldn't be written any better!

Looking at this article reminds me of my previous roommate!

He constantly kept talking about this. I'll send this article to him.
Fairly certain he'll have a great read. I appreciate you for sharing!
manicure
دوشنبه 21 فروردین 1396 07:08 ب.ظ
My brother recommended I might like this website. He was totally right.

This post actually made my day. You cann't imagine just
how much time I had spent for this info! Thanks!
 
لبخندناراحتچشمک
نیشخندبغلسوال
قلبخجالتزبان
ماچتعجبعصبانی
عینکشیطانگریه
خندهقهقههخداحافظ
سبزقهرهورا
دستگلتفکر




Admin Logo
themebox Logo