How to extract email from string using regular expression in c#

Опубликовано: 24 Март 2026
на канале: IT Core Soft
81
0

Download from this link: https://github.com/hamza3344/extracte...
regular expression: [a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-zA-Z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?\.)+[a-zA-Z0-9](?:[a-zA-Z0-9-]*[a-zA-Z0-9])?

My fiverr link: https://www.fiverr.com/hamzakhalid178
My Upwork Profile: https://www.upwork.com/freelancers/~0...

Whatsapp Number: +923338672398
contact me on [email protected] for custom software's.
Please share and like the video and subscribe the channel
If any question comment below

for supporting the channel
make a honeygain account by my referral link and make a passive income for me and you.

https://r.honeygain.me/HAMZA16262

code:

static string regularexpression = @"\d+";
//the regular expression in the description
Regex _filteremail=new Regex(regularexpression,RegexOptions.Compiled);
public string getemail(string getemail)
{
string s1 = "";
foreach(Match m in _filteremail.Matches(getemail))
{
if (!s1.Contains(m.Value))
{
s1=s1+m.Value+Environment.NewLine;
}
}
return s1;
}