Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
ECMAScript (JavaScript)

/
^(http(s?):\/\/)?(((25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?))|([a-zA-Z0-9\-\_]+(\.[a-zA-Z]{2,3})))+(\/[a-zA-Z0-9\_\-\s\.\/\?\%\#\&\=]*)?\.xml$
/

Description

validates an xml URL. Allows ips and domain names

Submitted by allofus - 8 years ago