<< < 1 2 3 4 5 6 > >>   Sort: Rank

Email addresse basic validation
How to perform a basic validation on email address using a regular expression? For example, " test+email@fexample.com " is an invalid email address. To perform a basic validation on email addresses, try this regular expression: ^\D\w+(\.\w+)*[@]\w+(\.\w+)*\. [a-zA-Z]{2,4}$
2013-01-27, 7299👍, 0💬

US phone number validation
How to perform a validation on US phone numbers using a regular expression? For example, " (021)423-2323 " is an valid US phone number. To perform a validation on US phone numbers, try this regular expression: ^\(?\d{3}\)?[-\s.]?\d{3}[-\s.] \d{4}$
2013-01-27, 3300👍, 0💬

IP address validation
How to perform a validation on IP addresses using a regular expression? For example, " 198.168.1.78 " is an valid IP address. To perform a validation on IP addresses, try this regular expression: ^(([1-9]?\d|1\d{2}|2[0-4]\d|25 [0-5]).){3}([1-9]?\d|1\d{2}|2[ 0-4]\d|25[0-5])$
2013-01-27, 2943👍, 0💬

US post code validation
How to perform a validation on US post codes using a regular expression? For example, " 12345-5434 " is an valid US post code. To perform a validation on US post codes, try this regular expression: ^([0-9]{5})(-[0-9]{4})?$
2013-01-27, 3041👍, 0💬

Negative look-ahead assertion (?!...)
What is a negative look-ahead assertion? How to use it? How to write a regular expression to find words without 'oo' in text like: how, to, look, google, school ? A negative look-ahead assertion is a zero-width assertion that allows you to not match a subpattern beyond the current position (look-ahe...
2013-01-26, 3278👍, 0💬

Positive look-ahead assertion (?=...)
What is a positive look-ahead assertion? How to use it? How to write a regular expression to find words with 'oo' in text like: how, to, look, google, school ? A positive look-ahead assertion is a zero-width assertion that allows you to match a subpattern beyond the current position (look-ahead) wit...
2013-01-26, 3136👍, 0💬

None capturing group (?:...)
Is there any to stop capturing a group to improve matching performance? How to write a possessive quantified subpattern to match double-quoted strings like this: "He said: \“Hello!\”" ? Yes. To turn the default capturing behavior on a group, you can entered '?:' at the beginning of the group a...
2013-01-26, 2969👍, 0💬

Comments in regular expression (?#...)
Is there any way to enter a comment into regular expressions? How to write a regular expression with comments to match date strings in yyyy-mm-dd format like: 2013-01-26 Yes. Comments can be entered in regular expressions using (?#...) format. For example: "(?:[^"\]++(?#no-backtracking) |\.)*+(?#no-b...
2013-01-26, 3679👍, 0💬

Quoted sequence \Q...\E
What is the quoted sequence to disable pattern metacharacters? How to write a regular expression to capture the main() method in a Java class like: class ABC { public static void main(String args[]){...} } The quoted sequence is a subpattern where pattern metacharacters are treated literally. A quot...
2013-01-26, 3926👍, 0💬

Escape sequence - Character in hexadecimal \x.. \x{..}
What is the escape sequence for a character written in hexadecimal format? How to write a regular expression to capture the escape (Backslash) \ character in a string like: \x5C The escape sequence for any character in hexadecimal format is '\x..' or \x{..}, '..' is the 2 hexadecimal digits. For exa...
2013-01-26, 5189👍, 0💬

Escape sequence - Character in octal \... \o{...}
What is the escape sequence for a character written in octal format? How to write a regular expression to capture the escape (Backslash) \ character in a string like: \x5C The escape sequence for any character in octal number format is '\...' or \o{...}, '...' is the 3 octal digits. For example: \06...
2013-01-26, 4449👍, 0💬

Escape sequence - New Line character \n
What is the escape sequence for the New Line or Line Feed character? How to write a regular expression to capture the last character before the New Line character? The escape sequence for the New Line or Line Feed character is \n, which is the same as \x0A. The regular expression to capture the last...
2013-01-26, 3957👍, 0💬

Escape sequence - Carriage Return character \r
What is the escape sequence for the Carriage Return character? On Unix systems, a line break is a single New Line character. But on Windows systems, a line break is a Carriage Return character followed by a New Line character. How to write a regular expression to capture line breaks for both systems...
2013-01-26, 4331👍, 0💬

Escape sequence - Tab character \t
What is the escape sequence for the Tab character? How to write a regular expression to captures tab delimited fields like this: Milk $0.99 No tax ? The escape sequence for the Tag character is \t, which is the same as \x09. The regular expression to capture tab delimited fields is: ([^\t]*+)\t? [^\...
2013-01-26, 3799👍, 0💬

1 or 0 times repetition quantifier ?
What is the 1 or 0 times repetition quantifier? How to use it? How to write a regular expression using a 1 or 0 times repetition quantifier to capture both spellings of skilful and skillful ? The "1 or 0 times" repetition quantifier allows us to create a special logical OR operation of "match the pa...
2013-01-26, 2732👍, 0💬

1 or more times repetition quantifier +
What is the 1 or more times repetition quantifier? How to use it? How to write a regular expression using a repetition quantifier to capture all words in a PHP script code like this: function get($key) {if (array_key_exists($key,$_POST) )return $_POST[$key]; else return "";} ? --- Answer The "1 or m...
2013-01-26, 2760👍, 0💬

0 or more times repetition quantifier *
What is the 0 or more times repetition quantifier? How to use it? How to write a regular expression using a repetition quantifier to capture all names and values in a URL query string like this: User=Jack&Age=&City=Pa ris? The "0 or more times" repetition quantifier allows us to repeat a pat...
2013-01-26, 2897👍, 0💬

Exact n times repetition quantifier {n}
What is the exact n times repetition quantifier? How to use it? How to write a regular expression using a repetition quantifier to capture Visa card numbers that have 16 digits like this: 4111111111111111 ? The "exact n times" repetition quantifier allows us to repeat a pattern unit exactly n times ...
2013-01-26, 2780👍, 0💬

Limited number of repetitions quantifier {n,m}
What is the limited number of repetitions quantifier? How to use it? How to write a regular expression using a repetition quantifier to ensure my password is between 8 and 12 characters long like this one: 9EA979114C ? The "limited number of repetitions" quantifier allows us to repeat a pattern unit...
2013-01-26, 2755👍, 0💬

n or more times repetition quantifier {n,}
What is the "n or more times" repetition quantifier? How to use it? How to write a regular expression using a repetition quantifier to capture the value of PI like: 3.1415926535897932384626433832 795028841971with a precision of at least 5 decimal digits? The "n or more times" repetition quantifier a...
2013-01-26, 2828👍, 0💬

Regular-Expressions.info
What resources are offered at Regular-Expressions.info? Regular-Expressions.info is the premier website about Regular Expressions offering Complete Regular Expression Tutorial and Applications & Languages That Support Regexes. Regular-Expressions.info
2013-01-26, 3383👍, 0💬

Backtracking of quantified subpatterns
What is backtracking of quantified subpatterns? What does it mean that a quantified subpattern is "backtracked"? How to show that a quantified subpattern is "backtracked" on this PHP script: if ($t=10): echo "Just started...!"; endif; if ($t=11): echo "Hungry!"; endif; if ($t=12): echo ""Ah, lunch-t...
2013-01-26, 2722👍, 0💬

Possessive (non-backtracking) quantified subpatterns ++ *+ {}+
What is possessive (non-backtracking) quantified subpatterns? How to write a possessive quantified subpattern to match double-quoted strings like this: "He said: \“Hello!\”" ? If you don't want the default backtracking behavior of quantified subpatterns, you can turn it off by adding the "poss...
2013-01-26, 2856👍, 0💬

"non-greedy" on quantified subpatterns +? *? {}?
How turn off the the greediness of quantified subpatterns? I want the quantified subpattern to be matched the minimum number of times possible? How to create a "non-greedy" quantified subpattern on this PHP script: if ($t=10): echo "Just started...!"; endif; if ($t=11): echo "Hungry!"; endif; if ($t...
2013-01-26, 3557👍, 0💬

<< < 1 2 3 4 5 6 > >>   Sort: Rank