Skip to content
This repository has been archived by the owner on Jul 11, 2023. It is now read-only.

Commit

Permalink
Wrote a very basic address recogniser.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Y committed Nov 11, 2014
1 parent 3e737bd commit 15643b0
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions app.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,7 @@
* @return {Boolean} Does the body have an address?
**/
var hasAddress = function (text) {
// TODO - Write address recogniser.
return false;
return /^\s*(\d*)\s*([a-z]+\s*)+(([a-z]+[.]?)\s*,?)?\s*(([a-z]*\s*)*,?)?\s*(V(irgini)?a)?\s*$/i.test(text)
};

/**
Expand Down

0 comments on commit 15643b0

Please sign in to comment.