irc-radio-bot/helpers/strings.js
2019-12-25 12:47:09 +01:00

9 lines
226 B
JavaScript

module.exports = {
formatString: function (string) {
if (string !== undefined && string !== null) {
return new RegExp('^' + string.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&') + '$', 'i')
}
return ';'
}
}