Regular Expressions 101

Community Library Entry

0

Regular Expression
ECMAScript (JavaScript)

/
(?<Street>\d.+(?:court|ct|street|st|drive|dr|lane|ln|road|rd|blvd))(?:,\W*)((?<Suite>\w.+?)(?:,\W*))?(?<City>\w.+?)(?:,\W*)(?<State>[a-z]+)(?:\W*)(?<Zipcode>\d{5})
/
gmi

Description

This is used to parse Address text.

TEST DATA: 39 w. 38th Street, 10th Floor, NY, NY 10018 39 w. 38th Street, NY, NY 10018

Submitted by anonymous - 6 years ago