Back to the main page
Can't find the answer? Ask
Submit Articles
Publish your articles and reach thousands of readers worldwide.
Publish
■ Welcome Guest, LogIn
■ Connexion avec 
Category : Technology | Posted by : Jojo | Posted on : 9/18/2008 | Updated on : 9/18/2008
Keywords : solution, and, net, find, help, with, urls, asp, emails, automatically, hyperlink, pages, string, how
How to automatically find and hyperlink URLs & Emails in a string in ASP.NET Pages with C#
How to automatically find and hyperlink URLs & Emails in a string in ASP.NET Pages with C#

The Answer
I'm using this 2 regex functions in my projects :

Regex urlregex = new Regex(@"(http:\/\/([\w.]+\/?)\S*)", RegexOptions.IgnoreCase | RegexOptions.Compiled);

and

Regex emailregex = new Regex(@"([a-zA-Z_0-9.-]+\@[a-zA-Z_0-9.-]+\.\w+)",RegexOptions.IgnoreCase | RegexOptions.Compiled);

more info here http://www.codeproject.com/KB/aspnet/Autohyperlink.aspx

Other languages : Verkus in English English, Verkus en Français Français. Terms of use | Privacy Policy | Help © Verkus 2008-2010, All rights reserved.