Regular Expressions 101

Community Patterns

Community Library Entry

2

Regular Expression
ECMAScript (JavaScript)

/
^[a-zA-Z0-9-\_]+\.[a-zA-Z]+?$
/
i

Description

For testing domain with TLD

regExp.test("google.com") => true regExp.test("mad.engineering") => true

Submitted by Sergio de la Garza - 9 years ago