<commit_before>'use strict';

var _toString = Object.prototype.toString;
var regexType = '[object RegExp]';

module.exports = function isRegex(value) {
	return _toString.call(value) === regexType;
};

<commit_msg>Use RegExp#exec to test if something is a regex, which works even with ES6 @@toStringTag.<commit_after>'use strict';

var regexExec = RegExp.prototype.exec;

module.exports = function isRegex(value) {
	try {
		regexExec.call(value);
		return true;
	} catch (e) {
		return false;
	}
};


{'fraction_non_alphanumeric': 0.1282565130260521, 'fraction_numerical': 0.002004008016032064, 'mean_word_length': 4.882352941176471, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '269565', 'n_tokens_mistral': 166, 'n_tokens_neox': 160, 'n_words': 45}