Wyrażenie regularne, aby usunąć puste linie po tekście
Find: ^(?:[\t ]*(?:\r?\n|\r))+
Replace: ""
Nasty Newt
Find: ^(?:[\t ]*(?:\r?\n|\r))+
Replace: ""
/^(?!\s*$).+/
/^$/ // match exactly ""
const REGEXP = /^$/;
const validate = (text) => {
return REGEXP.test(text);
}
const isEmpty = validate("");
const isNotEmpty = validate("x");
console.log(isEmpty); //true
console.log(isNotEmpty); //false
^(?!\s*$).+
const REGEXP = /^$/;
const validate = (text) => {
return REGEXP.test(text);
}
const isNotEmpty = validate("x");
const isEmpty = validate("");
console.log(isNotEmpty); //false
console.log(isEmpty); //true