var _ = require('lodash');
var sub = require('string-sub');

var base = require('../base');

var STR_SUB_HAS_CHANGED = base.STR_SUB_HAS_CHANGED;

var REGEX = require('../regex');

var btnRegex = REGEX.REGEX_BTN_CLASS;
var getRegExp = REGEX.getRegExp;

var js = {};

_.forEach(
	REGEX.MAP_CLASS_NAMES_CONVERT_JS,
	function(item, index) {
		js[index] = {
			message: function(result, rule, context) {
				return sub(STR_SUB_HAS_CHANGED, result[0], item);
			},
			regex: getRegExp('\\b(-)?(' + index + ')\\b', 'g'),
			replacer: function(result, rule, context) {
				var rawContent = context.rawContent;

				rawContent = rawContent.replace(rule.regex, rule._formatReplacement());

				return rawContent;
			},
			test: function(content, regex, rule) {
				if (!btnRegex.test(content)) {
					return content.match(regex);
				}
			},
			_formatReplacement: function() {
				var formattedReplacement = item;

				var items = formattedReplacement.split(' ');

				if (items.length > 1) {
					formattedReplacement = _.map(
						items,
						function(className, index) {
							if (index > 0) {
								className = '.' + className;
							}

							return className;
						}
					).join(' ');
				}

				return formattedReplacement;
			}
		};
	}
);

module.exports = js;
@@ -748,20 +748,100 @@
 ) %7B%0A%09%09%09%09
-if (
+var match = content.match(regex);%0A%0A%09%09%09%09if (match && !_.startsWith(match%5B0%5D, '-') && 
 !btnRege
@@ -871,36 +871,21 @@
 %09return 
-content.match(regex)
+match
 ;%0A%09%09%09%09%7D%0A

Add back check for dash