regex to match empty string

Solutions on MaxInterview for regex to match empty string by the best coders in the world

showing results for - "regex to match empty string"
Nour
13 Jul 2016
1/^(?!\s*$).+/
Yann
20 Jan 2017
1const REGEXP = /^$/;
2
3const validate = (text) => {     
4    return REGEXP.test(text);
5}
6
7const isEmpty = validate("");
8const isNotEmpty = validate("x");
9
10console.log(isEmpty); //true
11console.log(isNotEmpty); //false
Cathy
28 Mar 2020
1/^$/ // match exactly ""
queries leading to this page
regex search for empty stringregex 1 or emptyregex validate emptyregex repcale string with emptyregex how to match empty stringregex for empty stringregexp match string or emptyregex for not emptyempty string in regexnot empty string regesnon empty regexregez for empty stringregex for not empty stringregex for empty string validationregex to match empty stringregexp null and empty checkregex for checking an empty stringregex ignore empty stringempty in regexregex empty string falseregex match only empty stringregex check for empty string orregex if empty stringregex must be emptycheck empty string in regexmatch empty regexregex match not empty stringnumber or empty regexregex empty string as resultregex to match any empty fieldregex if not empty then match other regexregex check if emptyregex for checking if value is emptyregular expression for non empty stringmatch regex emptyregex can be emptyregex that matches empty stringregex expression for space or emptyregex to check non empty stringgregex check if string is emptyregex to check non empty stringnot empty with regex checkregex empty or string 3a empty regular expressionallow empty string in regexregex cheat empty stringvalidate empty string regexregex match empty string or wordregex validate empty stringempty string regexregex not emptyregex can only be emptyregular expression matching only the empty stringregular expression empty or stringregex returning empty stringregex number 2b emptyregex match 1 or emptyregex or emptyregex for emptyregex empty string or nullnon empty regexregex match empty linenon empty string regexregular expression string not emptyregex to check empty stringregex match string or emptyregex pattern not empty stringsign for empty string regular expressionregex match anything but empty stringempty regex patternregex for checking emptymatch empty line regexregex empty string or patternregex plus emptyregex remove the empty string from stirngregex not null or emptyregular expression empty stringc 23 regular expression for non empty stringregex blankregex et empty stringempty regexregex replace empty stringregex empty or patternhow to remove empty string in regexregex check not empty stringempty regex stringregex block empty stringregular expression for empty stringregex empty or numbersregex check for empty stringreg should not match empty string in jsregex number or emptyregex empty string 5cregex empty stringmatches empty regexregex enable empty stringregex match null characterreturn empty string if regex matchesnot empty string regexregex pattern allow empty stringregex to allow empty stringregular expression do not allow empty stringhow to match empty string regexregex is emptyregex string full or emptyregex pattern of empty stringregex that checks if not emptyregex if emptyhow to empty regex when emptyvalidate not empty string regexregex empty string or specific wordregex catching empty stringsregex match if string not emptyregex to detect empty stringhow to check empty string using regexregular expression non empty stringregex pattern for non empty stringregex if not emptyon empty regexdon 27t match empty character regexregex check if string is not emptyregex blank textregex if empty or a conditionhow to target empty string in regexregex no empty stringregex non empty stringregex is not emptyregular exp empty stringregex match 3a check whether or not a string is blankregex match empty stringregex for non empty stringregex empty or nullregular expression empty characterempty string match regexregex can be empty orregex allow empty stringsregex an empty stringblank string regexregex empty charregex not match empty stringregex either string or emptyregex non empty stringregex empty string or numberregexr match empty stringcheck if the string is empty in regexregex match any character but emptyregex for blank stringregular expression to check if string is not emptyregex for is empty stringregex is not empty stringregex empty string matchregex for non blank non emptyempty string check regexregexp for an empty stringregex check if the letter is emptyregex match non empty stringregex prevent empty stringempty string matches regexempty string not in regexregex to check non empty textregex check null or emptyregex emptyregex match anything except empty stringregex null or emptyregex allow empty stringregex is nor empty stringregex pattern to check not empty stringregex numeric string no emptyregex empty lineregex that allow empty stringsregex match not emptyregex do not validate if empty stringregex not empty stringregex for checking if string is empty regex match1 or emptyregex test not null and emptyregex string not emptyregex match emptycheck non empty string regexregex search empty stringregular expression empty or other stringregex to match empty string