public Form1() { InitializeComponent(); textBox1.Text = "http://www.site.com/Documents/file.pdf"; Match matchPdf = Regex.Match(textBox1.Text, @"\*+(.pdf|.PDF)$/", RegexOptions.IgnoreCase); Match matchImg = Regex.Match(textBox1.Text, @"\*+(.jpeg|.JPEG|.gif|.GIF| .png|.PNG)$/", RegexOptions.IgnoreCase); if (matchPdf.Success) { label1.Text = "PDF"; } else if (matchImg.Success) { label1.Text = "IMG"; } else label1.Text = "UNIVERSAL"; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)