This regex pattern will match an empty string:
^$
And this will match (crudely) an email or an empty string:
(^$|^.*@.*\..*$)
Related Posts:
- How can I exclude one word with grep?
- How can I validate an email address using a regular expression?
- How can I validate an email address using a regular expression?
- Split string on whitespace in Python
- How to validate an email address in PHP
- How to replace ” \ ” with ” \\ ” in java
- Regex how to match an optional character
- How to validate an email address in JavaScript
- How can I remove punctuation from input text in Java?
- How can I remove punctuation from input text in Java?
- Regular expression – starting and ending with a character string
- OR condition in Regex
- Regex not operator
- What does \’.- mean in a Regular Expression
- Regex not operator
- Regex not operator
- Regex: ignore case sensitivity
- What does the regex \S mean in JavaScript?
- Regex: ignore case sensitivity
- What is the difference between the regular expressions [^\d\s] and [\D\S]
- grep –ignore-case –only
- Regex AND operator
- python re.split() to split by spaces, commas, and periods, but not in cases like 1,000 or 1.50
- Regular expression negative lookahead
- Regex how to match an optional character
- Regular Expression to match string starting with a specific word
- Regular Expressions: Is there an AND operator?
- Writing a very simple lexical analyser in C++
- Regular expression to match standard 10 digit phone number
- Regular Expression.how to add optional character at end of regex
- Regular Expression with wildcards to match any character
- How to find all occurrences of a substring?
- Regular expression to match standard 10 digit phone number
- Python string.replace regular expression
- how to replace quotation marks with \”
- Python string.replace regular expression
- Regex – Does not contain certain Characters
- A regular expression to exclude a word/string
- Using Bash regex match (=~) where regex includes quotes (” characters)
- Searching for UUIDs in text with regex
- What does regular expression \\s*,\\s* do?
- Regular expression for exact match of a string
- Using the star sign in grep
- Regex optional group
- Question marks in regular expressions
- Difference between \w and \b regular expression meta characters
- Regular Expression – Validate Gmail addresses
- Remove all special characters, punctuation and spaces from string
- Java; String replace (using regular expressions)?
- How can I output only captured groups with sed?
- How to negate specific word in regex?
- What is the grep equivalent in Python?
- Which regular expression operator means ‘Don’t’ match this character?
- Python re.split() vs split()
- How can I write a regex which matches non greedy?
- How can I match a string with a regex in Bash?
- Regex Explanation ^.*$ [duplicate]
- How to exclude a specific string constant?
- How to replace a whole line with sed?
- Regex match everything after question mark?
- Validating IPv4 addresses with regexp
- Validate phone number with JavaScript
- Regex to match only uppercase “words” with some exceptions
- Regex to match only letters
- Regex optional capturing group?
- Finding the complement of a DFA?
- RE error: illegal byte sequence on Mac OS X
- Regex Match all characters between two strings
- Regular expression to match a word or its prefix
- How can I extract a number from a string in JavaScript?
- Regular expressions in C: examples?
- How to ignore whitespace in a regular expression subject string?
- Regular expression for a string that does not start with a sequence
- How to extract a substring using regex
- Regex: matching up to the first occurrence of a character
- python regular expression “\1”
- Regular expression to stop at first match
- How to use regex in String.contains() method in Java
- /bb|[^b]{2}/ how does it work?
- Regular expression to remove HTML tags from a string
- Regular expression to limit number of characters to 10
- Regex that matches integers in between whitespace or start/end of string only
- Regular Expressions- Match Anything
- My Vim replace with a regex is throwing a `E488: Trailing characters`
- Regex for “AND NOT” operation
- Using strip() to clean up a string
- Regular expression that matches valid IPv6 addresses
- Escaping Parentheses in Regex
- How to replace a string in an existing file in Perl
- What is the best regular expression to check if a string is a valid URL?
- Wrap element with in any number of elements with PHP
- extract shortcodes from string
- preg_replace and comment_form_defaults
- How to set up redirects for category paginated pages after adding /category/ to permalink
- Redirect non www to www using redirection plugin regex
- Restrict comments with regular expression
- How to fix old embeded iframes with WP-CLI search-replace
- Avoid too long words in a post title, post content or comment but only if its not a url
- Regex For Extracting First 4 letters of search term
- Use Regex Redirection via htsaccess for RSS Feeds WordPress