Skip to content

Commit

Permalink
Remove redundant backslash from regexp
Browse files Browse the repository at this point in the history
  • Loading branch information
denisx authored and andrewplummer committed Aug 16, 2018
1 parent 3bed7d1 commit 7e51f7a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ var NO_KEYS_IN_STRING_OBJECTS = !('0' in Object('a'));
var PRIVATE_PROP_PREFIX = '_sugar_';

// Matches 1..2 style ranges in properties.
var PROPERTY_RANGE_REG = /^(.*?)\[([-\d]*)\.\.([-\d]*)\](.*)$/;
var PROPERTY_RANGE_REG = /^(.*?)\[([-\d]*)\.\.([-\d]*)](.*)$/;

// WhiteSpace/LineTerminator as defined in ES5.1 plus Unicode characters in the Space, Separator category.
var TRIM_CHARS = '\u0009\u000A\u000B\u000C\u000D\u0020\u00A0\u1680\u180E\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200A\u202F\u205F\u2028\u2029\u3000\uFEFF';

// Regex for matching a formatted string.
var STRING_FORMAT_REG = /([{}])\1|\{([^}]*)\}|(%)%|(%(\w*))/g;
var STRING_FORMAT_REG = /([{}])\1|{([^}]*)}|(%)%|(%(\w*))/g;

// Common chars
var HALF_WIDTH_ZERO = 0x30,
Expand Down Expand Up @@ -1175,7 +1175,7 @@ function getRegExpFlags(reg, add) {

function escapeRegExp(str) {
if (!isString(str)) str = String(str);
return str.replace(/([\\\/\'*+?|()\[\]{}.^$-])/g,'\\$1');
return str.replace(/([\\/'*+?|()[\]{}.^$-])/g,'\\$1');
}

// Date helpers
Expand Down

0 comments on commit 7e51f7a

Please sign in to comment.