Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Commit

Permalink
Trivial fix on regex escape
Browse files Browse the repository at this point in the history
  • Loading branch information
MrOrz committed Jun 12, 2012
1 parent 1a509a0 commit 7a65789
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/backends/localStorage.js
@@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 7a65789

Please sign in to comment.