Skip to content

Commit

Permalink
improving RegExp escaping - via @abozhilov https://twitter.com/abozhi…
Browse files Browse the repository at this point in the history
  • Loading branch information
rodneyrehm committed Dec 27, 2011
1 parent d807a7e commit 85ac217
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/URI.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
(function(undefined) {

function escapeRegEx(string) {
return string.replace(/[$^\.*+?()[\\]{}|]/g, "\\" + "$1");
return string.replace(/[$^\\.*+?()[\]{}|]/g, "\\$&");
}

function isArray(obj) {
Expand Down

0 comments on commit 85ac217

Please sign in to comment.