diff --git a/dev/js/spec/vcSpec.js b/dev/js/spec/vcSpec.js
index 3159101..24b24a7 100644
--- a/dev/js/spec/vcSpec.js
+++ b/dev/js/spec/vcSpec.js
@@ -323,15 +323,20 @@
       expect(doc.toQuery()).toEqual('title = /[^b]ee.+?/');
 
       doc = regexFactory.create({
-	match: "match:ne"
+	      match: "match:ne"
       });
       expect(doc.toQuery()).toEqual('title != /[^b]ee.+?/');
 
+      doc = regexFactory.create({
+	      value: "WPD/AAA/00001"
+      });
+      expect(doc.toQuery()).toEqual('title = /WPD\\/AAA\\/00001/');
+
       doc = dateFactory.create();
       expect(doc.toQuery()).toEqual('pubDate in 2014-11-05');
 
       doc = dateFactory.create({
-	value : "2014"
+	      value : "2014"
       });
       expect(doc.toQuery()).toEqual('pubDate in 2014');
     });
diff --git a/dev/js/src/util.js b/dev/js/src/util.js
index 00a2bd5..d803a9d 100644
--- a/dev/js/src/util.js
+++ b/dev/js/src/util.js
@@ -14,6 +14,11 @@
   return this.replace(_quoteRE, '\\$1');
 };
 
+var _escapeRE = new RegExp("([\/\\\\])", 'g');
+String.prototype.escapeRegex = function () {
+  return this.replace(_escapeRE, '\\$1');
+};
+
 // Add toggleClass method similar to jquery
 HTMLElement.prototype.toggleClass = function (c1, c2) {
   var cl = this.classList;
diff --git a/dev/js/src/vc/doc.js b/dev/js/src/vc/doc.js
index b56ba53..6a44fa8 100644
--- a/dev/js/src/vc/doc.js
+++ b/dev/js/src/vc/doc.js
@@ -567,7 +567,7 @@
         return string + this.value();
         break;
       case "regex":
-        return string + '/' + this.value() + '/';
+        return string + '/' + this.value().escapeRegex() + '/';
         break;
       case "string":
         return string + '"' + this.value().quote() + '"';
diff --git a/dev/js/src/vc/jsonld.js b/dev/js/src/vc/jsonld.js
index 324e7db..846d55c 100644
--- a/dev/js/src/vc/jsonld.js
+++ b/dev/js/src/vc/jsonld.js
@@ -15,21 +15,21 @@
      */
     upgradeTo : function (props) {
       for (var prop in props) {
-	this[prop] = props[prop];
+	      this[prop] = props[prop];
       };
       return this;
     },
     
     ldType : function (type) {
       if (arguments.length === 1)
-	this._ldType = type;
+	      this._ldType = type;
       return this._ldType;
     },
     
     parent : function (obj) {
       if (arguments.length === 1) {
-	this._parent = obj;
-	this.__changed = true;
+	      this._parent = obj;
+	      this.__changed = true;
       };
       return this._parent;
     },
@@ -39,19 +39,19 @@
     // I'm paranoid!
     destroy : function () {
       if (this._ops != undefined) {
-	this._ops._parent = undefined;
-	if (this._ops._element !== undefined)
-	  this._ops._element.refTo = undefined;
-	this._ops = undefined;
+	      this._ops._parent = undefined;
+	      if (this._ops._element !== undefined)
+	        this._ops._element.refTo = undefined;
+	      this._ops = undefined;
       };
       if (this._element !== undefined)
-	this._element = undefined;
+	      this._element = undefined;
       
       // In case of a group, destroy all operands
       if (this._operands !== undefined) {
-	for (var i = 0; i < this._operands.length; i++)
-	  this.getOperand(i).destroy();
-	this._operands = [];
+	      for (var i = 0; i < this._operands.length; i++)
+	        this.getOperand(i).destroy();
+	      this._operands = [];
       };
     },
     
@@ -61,11 +61,11 @@
       
       var group = require('vc/docgroup').create(parent);
       if (arguments.length === 1)
-	group.operation(op);
+	      group.operation(op);
       else
-	group.operation(
-	  this.operation() === 'and' ? 'or' : 'and'
-	);
+	      group.operation(
+	        this.operation() === 'and' ? 'or' : 'and'
+	      );
       group.append(this);
       this.parent(group);
       group.append();
@@ -77,9 +77,9 @@
     // Be aware! This may be cyclic
     operators : function (and, or, del) {
       if (arguments === 0)
-	return this._ops;
+	      return this._ops;
       this._ops = operatorsClass.create(
-	and, or, del
+	      and, or, del
       );
       this._ops.parent(this);
       return this._ops;
@@ -87,8 +87,8 @@
 
     toJson : function () {
       return {
-	// Unspecified object
-	"@type" : "koral:" + this.ldType()
+	      // Unspecified object
+	      "@type" : "koral:" + this.ldType()
       };
     },
 
diff --git a/dev/js/src/vc/stringval.js b/dev/js/src/vc/stringval.js
index c7a5d67..595057a 100644
--- a/dev/js/src/vc/stringval.js
+++ b/dev/js/src/vc/stringval.js
@@ -36,10 +36,10 @@
   regex : function (bool) {
     if (arguments.length === 1) {
       if (bool) {
-	this._regex = true;
+	      this._regex = true;
       }
       else {
-	this._regex = false;
+	      this._regex = false;
       };
       this._update();
     };
@@ -128,8 +128,8 @@
     re.addEventListener(
       'click',
       function (e) {
-	this.toggleRegex();
-	e.halt();
+	      this.toggleRegex();
+	      e.halt();
       }.bind(this),
       true
     );
@@ -138,19 +138,19 @@
     e.addEventListener(
       'blur',
       function (e) {
-	this.store(this.value(), this.regex());
-	e.halt();
+	      this.store(this.value(), this.regex());
+	      e.halt();
       }.bind(this)
     );
 
     this._input.addEventListener(
       'keypress',
       function (e) {
-	if (e.keyCode == 13) {
-	  this.value(this._input.value);
-	  this.store(this.value(), this.regex());
+	      if (e.keyCode == 13) {
+	        this.value(this._input.value);
+	        this.store(this.value(), this.regex());
           return false;
-	};
+	      };
       }.bind(this)
     );
 
