Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1 from MrOrz/patch-1

Trivial fix on regex escape
  • Loading branch information...
commit 5a6ab883234919532772bbbc646751015792768e 2 parents 1a509a0 + 7a65789
Heather Arthur authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/backends/localStorage.js
4 lib/backends/localStorage.js
View
@@ -1,7 +1,7 @@
var _ = require("underscore")._;
var LocalStorageBackend = function(options) {
- var options = options || {};
+ options = options || {};
var name = options.name || Math.floor(Math.random() * 100000);
this.prefix = 'classifier.bayesian.' + name;
@@ -61,7 +61,7 @@ LocalStorageBackend.prototype = {
toJSON : function() {
var words = {};
- var regex = new RegExp("^" + this.prefix + "\.words\.(.+)$")
+ var regex = new RegExp("^" + this.prefix + "\\.words\\.(.+)$")
for (var item in this.storage) {
var match = regex.exec(item);
if (match) {
Please sign in to comment.
Something went wrong with that request. Please try again.