1 2 >   Sort: Date

Regular Expression (RegEx) Information Center
Are you having problems using regular expressions when processing text strings in your applications or when editing text files? Welcome to visit this information center, where you can enhance your knowledge on regular expressions; learn how to write and test regular expressions. regex.fyicenter.com ...
2016-07-06, 11813👍, 1💬

Backreferences \g1, \g2, ...
What is a backreference? How to use a backreference? How to write a regular expression using a backreferences to capture 5-letter reversible words in a text string like this: civic, level, radar, rotor or stats ? Backreferences are references representing catured sub strings already matched in earli...
2013-01-23, 5585👍, 0💬

Strings Containing Neither A Nor B
How to match strings that contain neither A nor B using regex? Regular Expression does not support NOT operator on a sub pattern. "Neither A nor B" must be implemented by a "Negative Look-Ahead" assertion. Let's assume that we have following text: Answer is A. Answer is D. Answer is B. Answer is C. ...
2016-06-23, 5475👍, 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, 5384👍, 0💬

Regular Expression with Logical AND
How to write AND logic in regular expression? How to build a regular expression to identify the following email paragraph as a spam message because it contains the word "bank", "account" and "money"? " I am inviting you for a business deal where this money will be shared between of us in the ratio o...
2015-05-22, 5133👍, 0💬

Parsing file entries from Windows "dir" command
How to write a regular expression to parse file entries from the output of Windows "dir" command? Here is an example output of the "dir" command: Directory of C:\Windows\System32 01/30/2013 11:44 AM . 01/30/2013 11:44 AM .. 07/13/2009 11:56 PM 0409 01/16/2012 10:13 PM 1033 06/10/2009 04:16 PM 2,151 ...
2013-02-01, 4918👍, 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, 4574👍, 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, 4483👍, 0💬

Word character class - \w
What is abbreviation of a character class of all word characters? Does it represents any alphanumeric plus '_' characters? How to write a regular expression using a character class abbreviation to capture all words in a PHP script code like this: function get($key) {if (array_key_exists($key,$_POST) ...
2013-01-23, 4327👍, 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, 4072👍, 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, 4035👍, 0💬

Decimal digit character class - \d
What is abbreviation of a character class of all decimal digits? How to write a regular expression using a character class abbreviation to capture signed integer numbers in a text string like this: from -32768 to 32767 ? The predefined abbreviation of a character class of all decimal digits is \d, w...
2013-01-23, 4028👍, 0💬

Does negative character class match newline
Does negative character class [^a] match newline characters? How to write a regular expression to capture tags and attributes from this HTML code: A negative character class will match the newline character, if the newline character is not listed in the class. For example, "[^a]" will match the newl...
2013-02-02, 3963👍, 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, 3920👍, 0💬

Using negative character class [^...]
What is a negative character class? How to specify a negative character class in a regular expression? How to use negative character class to capture words that contains no vowel letters in this lyrics: Daddy started out in San Francisco, Tootin' on his trumpet loud and mean, Suddenly a voice said, ...
2013-02-02, 3900👍, 0💬

White space character class - \s
What is abbreviation of a character class of all white space ASCII characters? How to write a regular expression using a character class abbreviation to capture all white space characters in a text string like this: Name: Jack; Age: 25; City: Paris ? The predefined abbreviation of a character class ...
2013-01-23, 3879👍, 0💬

Negated word character class - \W
What is abbreviation of a negated character class of all word characters? Does it represents any characters except alphanumeric plus '_' characters? How to write a regular expression using a character class abbreviation to capture all sequences of non word characters in a PHP script code like this: ...
2013-01-23, 3842👍, 0💬

Negated decimal digit character class - \D
What is abbreviation of a negated character class of all decimal digits? Does it represents any characters except decimal digits? How to write a regular expression using a character class abbreviation to capture letters from a Canadian postal code string: L3R 9Z7 ? The predefined abbreviation of a n...
2013-01-23, 3795👍, 0💬

Negated white space character class - \S
What is abbreviation of a negated character class of all white space ASCII characters? Does it represents any characters except white space characters? How to write a regular expression using a character class abbreviation to capture tokens separated by white space characters in a text string like t...
2013-01-23, 3782👍, 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, 3759👍, 0💬

Positive look-behind assertion (?<=...)
What is a positive look-behind assertion? How to use it? How to write a regular expression to find words ending with 'oo' in text like: how, too, bamboo, school, ? A positive look-behind assertion is a zero-width assertion that allows you to match a subpattern left to the current position (look-behi...
2013-01-31, 3714👍, 0💬

Parsing directory entries from Windows "dir" command
How to write a regular expression to parse sub directory entries from the output of Windows "dir" command? Here is an example output of the "dir" command: Directory of C:\Windows 12/15/2012 09:24 AM . 12/15/2012 09:24 AM .. 07/13/2009 11:52 PM addins 01/19/2012 10:48 AM AppCompat 11/29/2012 09:16 AM...
2013-02-01, 3666👍, 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, 3661👍, 0💬

Using character class [...]
What is a character class? How to specify a character class in a regular expression? How to write a regular expression using character classes to capture 7 digits phone numbers from this example string " 123-4567, 123 4567 or 1234567 "? A character class allows a set of possible characters, rather t...
2013-02-02, 3524👍, 0💬

1 2 >   Sort: Date