Regular Expressions 101

Community Patterns

Community Library Entry

1

Regular Expression
Created·2015-03-12 11:48
Flavor·JavaScript

/
([\w][\w\d-]+\.[\w\d]{2,3})$
/
gmi
Open regex in editor

Description

I need to get the top level domain from the request header but it can be in a vary ways.. how can I match but exclude parts I dont want to get ie. ports

Submitted by nei