E
Evertjan.
VK wrote on 13 okt 2009 in comp.lang.javascript:
I think you mean ~{2,} not ~(2,)
no need for the , in ~{2,}, as more than two ~ are matched by two ~.
if (/[^\x00-\xff]|~~|discount|(hot |whole)sale/i.test(temp)) {
// do action
};
var FILTER_NO_EX = new RegExp('[\\u0100-\\uFFFD]','');
var FILTER = new RegExp('~(2,)|discount|hot sale|wholesale','i');
I think you mean ~{2,} not ~(2,)
no need for the , in ~{2,}, as more than two ~ are matched by two ~.
spam = FILTER_NO_EX.test(tmp);
if (!spam) {
spam = FILTER.test(tmp)
}
if (spam) {
// do action
}
if (/[^\x00-\xff]|~~|discount|(hot |whole)sale/i.test(temp)) {
// do action
};