Skip to content

Commit 23a3f64

Browse files
authored
Open up regex (#31)
* Open up regex. closes #24 * More semantic name for regex.
1 parent 27ceb88 commit 23a3f64

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

jquery.ziptastic.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
(function( $ ) {
22
var requests = {};
33
var zipValid = {
4-
us: /[0-9]{5}(-[0-9]{4})?/
4+
pattern: /^[a-z0-9]+$/i
55
};
66
var protocol = '';
77
if (location.protocol == 'file:') {
@@ -93,7 +93,7 @@
9393

9494
ele.on('keyup change', function() {
9595
var zip = ele.val();
96-
if(zipValid.us.test(zip)) {
96+
if(zipValid.pattern.test(zip)) {
9797
$.ziptastic(options.country, zip, options.key, function(country, state, state_short, city) {
9898
// Trigger the updated information
9999
ele.trigger('zipChange', [country, state, state_short, city, zip]);

0 commit comments

Comments
 (0)