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)
     );
 
