]> gerrit.simantics Code Review - simantics/district.git/blob - es5-ext/reg-exp/escape.js
Hide "enabled" column for non-component type tech type tables
[simantics/district.git] / es5-ext / reg-exp / escape.js
1 // Thanks to Andrew Clover:
2 // http://stackoverflow.com/questions/3561493
3 // /is-there-a-regexp-escape-function-in-javascript
4
5 'use strict';
6
7 var re = /[\-\/\\\^$*+?.()|\[\]{}]/g;
8
9 module.exports = function (str) { return String(str).replace(re, '\\$&'); };