Regular Expressions 101

Community Library Entry

0

Regular Expression
.NET 7.0 (C#)

@"
((([A-Za-z]{3,9}:(?:\/\/)?)(?:[-;:&=\+\$,\w]+@)?[A-Za-z0-9.-]+|(?:www.|[-;:&=\+\$,\w]+@)[A-Za-z0-9.-]+)((?:\/[\+~%\/.\w\-_]*)?\??(?:[-\+=&;%@.\w_]*)#?(?:[.\!\/\\w]*))?)
"
ig

Description

A neat regular expression to extract web urls and emails from a paragraph or a text stream.

Submitted by kosalanuwan - 2 years ago