Permalink
Browse files

use regexp literal

1 parent 04507e7 commit 43829c727a152f88d606d59986a1d6707cfd62bf @jarofghosts jarofghosts committed Nov 14, 2013
Showing with 14 additions and 12 deletions.
  1. +4 −3 lib/formatter.js
  2. +1 −1 lib/formatter.min.js
  3. +4 −3 lib/jquery.formatter.js
  4. +1 −1 lib/jquery.formatter.min.js
  5. +4 −4 src/formatter.js
View
@@ -22,9 +22,9 @@ var defaults = {
// Regexs for input validation
var inptRegs = {
- '9': new RegExp('[0-9]'),
- 'a': new RegExp('[A-Za-z]'),
- '*': new RegExp('[A-Za-z0-9]')
+ '9': /[0-9]/,
+ 'a': /[A-Za-z]/,
+ '*': /[A-Za-z0-9]/
};
//
@@ -406,6 +406,7 @@ Formatter.prototype._addChar = function (i) {
// Update value
this.val = utils.addChars(this.val, char, i);
};
+
// Define module
var pattern = {};
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -18,9 +18,9 @@ var defaults = {
// Regexs for input validation
var inptRegs = {
- '9': new RegExp('[0-9]'),
- 'a': new RegExp('[A-Za-z]'),
- '*': new RegExp('[A-Za-z0-9]')
+ '9': /[0-9]/,
+ 'a': /[A-Za-z]/,
+ '*': /[A-Za-z0-9]/
};
//
@@ -402,6 +402,7 @@ Formatter.prototype._addChar = function (i) {
// Update value
this.val = utils.addChars(this.val, char, i);
};
+
// Define module
var pattern = {};
Oops, something went wrong.

0 comments on commit 43829c7

Please sign in to comment.