Regular Expressions 101

Community Patterns

123...6

URL Validation

0

Regular Expression
.NET 7.0 (C#)

@"
^(?=(?<http>(?:https?:\/\/){1}(?:www\.)?)?)(?(?=\k<http>?(?<ipaddr>(?:\d{1,3}\.){3}\d{1,3}(?:\:\d{1,5})?))\k<http>?\k<ipaddr>(?:\.[\w]{1,9})?|\k<http>(?:[\w]\.?){1,255}\.[\w]{1,9})(?:\/.*)?$
"
gm

Description

Can be used to validate on URL's.

Submitted by anonymous - 10 months ago