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

Finding & characters in HTML document
How to find &amp; characters that are not part of HTML entities in HTML code? The the example HTML code is listed below: a & b c &amp; d a &lt; b c &#8364; d c && d The regular expression to find &amp; characters that are not part of HTML entities in an HTML document ...
2013-02-02, 3244👍, 0💬

Finding mismatching quotes in a code line
How to find mismatching quotes "..." in a program code line with a regular expression? The the example program code is listed below: error = "Line "+line+" position "+position+" has invalid character "+char; warning = "The quote character (") may cause problem at line "+line+" position "+position; T...
2013-02-02, 2882👍, 0💬

Using multiple lines and single line modifiers together - ms
What happens if I use multiple lines modifier, m, and single line modifier, s, together? How to write a regular expression to capture each bullet statement from this sample text: - The DAEMON or VENDOR label. - If the path is missing or incorrect, the product placed in the same directory as the x da...
2013-02-02, 3092👍, 0💬

Single line modifier - s
What is the single line modifier? How to use it? How the single line modifier can be used on this example text: class Hello { public static void main(String[] args) { System.out.println("Hello World!"); // Display the string. } } The single line modifier 's', also called "dot all" modifier, modifies...
2013-02-02, 3384👍, 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, 3838👍, 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, 3466👍, 0💬

Multiple line modifier - m
What is the multiple line modifier? How to use it? How the multiple line modifier can be used on this example text: 06/10/2009 04:21 PM 69,584 avicap.dll 06/10/2009 04:21 PM 109,456 avifile.dll 07/13/2009 04:41 PM 32,816 COMMDLG.DLL 07/13/2009 04:41 PM 2,000 keyboard.drv 06/10/2009 04:42 PM 9,936 lz...
2013-02-02, 3325👍, 0💬

Parsing directory name and size from Windows "dir" command
How to write a regular expression to parse directory name and total file size from the output of Windows "dir" command? Here is an example output of the "dir" command: Directory of C:\Windows\system 07/13/2009 11:52 PM . 07/13/2009 11:52 PM .. 06/10/2009 04:21 PM 69,584 avicap.dll 06/10/2009 04:21 P...
2013-02-01, 6141👍, 0💬

RegexMagic: Regular Expression Generator
What is RegexMagic? RegexMagic makes creating regular expressions easier than ever. While other regex tools such as RegexBuddy merely make it easier to work with regular expressions, with RegexMagic you don't have to deal with the regular expression syntax at all. RegexMagic generates complete regul...
2013-02-01, 4398👍, 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, 3600👍, 0💬

Parsing header lines of an email message
How write a regular expression to capture all header lines from an email message like this: Return-Path: X-Original-To: test@example.com Delivered-To: test@example.com Message-ID: Date: Thu, 23 Jun 2011 11:26:29 +0200 From: Example Sender To: Example Receiver Subject: Email example Hello Joe, It was...
2013-02-01, 2966👍, 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, 4807👍, 0💬

Positive look-behind assertion (?&lt;=...)
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, 3631👍, 0💬

Negative look-behind assertion (?&lt;!...)
What is a negative look-behind assertion? How to use it? How to write a regular expression to find words not ending with 'oo' in text like: how, too, bamboo, school, ? A negative look-behind assertion is a zero-width assertion that allows you to not match a subpattern left to the current position (l...
2013-01-31, 3393👍, 0💬

Parsing the "To:" field from emails
What would be the correct regex pattern to extract email addresses from a string coming from an email form "To" line, that allows the addresses to be delimited by commas ",", semicolons ";", or spaces? For example, the following "To" line contains 4 email addresses: "Joe Smith" , joe@aol.com; someon...
2013-01-30, 2988👍, 0💬

Validating Brazilian Postcodes
How to write a regular expression to validate Brazilian Postcodes? For example, 23080-060 is a valid Brazilian Postcodes. Here is the regular expression to validate Brazilian Postcodes: \d{5}-\d{3} \d{5} - 2 digits - - A - \d{3} - 3 digits
2013-01-29, 3107👍, 0💬

Validating United Kingdom postcodes
How to write a regular expression to validate United Kingdom postcodes? For example, EC1A 1BB is a valid UK postcodes. Here is the regular expression to validate United Kingdom postcodes: [A-Z]{1,2}\d[A-Z\d]? \d[ABD-HJLNP-UW-Z]{2} [A-Z]{1,2} - 1 or 2 letters \d - A digit [A-Z\d]? - An optional lette...
2013-01-29, 2960👍, 0💬

Validating Canadian Postal Codes
How to write a regular expression to validate Canadian Postal Codes? For example, T2X 1V4 is a valid Canadian postal codes. Here is the regular expression to validate Canadian postal codes: [ABCEGHJKLMNPRSTVXY]\d[A-Z] ?\d[A-Z]\d [ABCEGHJKLMNPRSTVXY] - 18 FSA possible letters \d - A digit [A-Z] - Any...
2013-01-29, 2836👍, 0💬

Validating Complexity and Length of Passwords
How to write a regular expression to check the complexity and length of passwords with the following requirements: Password must be at least 6 characters long Password must include at least including 1 upper case letter Password must include at least including 1 lower case letter Password must inclu...
2013-01-29, 3140👍, 0💬

Detecting missing closing parenthesis in program code
How to detect missing closing parenthesis in program code using regular expression? For example, I have the following program code: n = - (LN(1-(B/m)*(r/q))/LN(1+(r/q)) ;Can anyone help?
2013-01-29, 4158👍, 0💬

Finding content between two quotes
How to find content between two quotes in a text string using regular expression? For example, I have the following string: print "\$45.00\n"; Here is the regular expression to capture the content between two quotes: "([^"]*)"
2013-01-29, 2913👍, 0💬

Finding blank lines in a text file
How to find blank lines in a text file using regular expression? You can use the following logic to find blank lines in a text file: 1. Read each line from the text file in a loop. 2. Validate each line with this regular expression: ^\s*$ 3. If matched, you know that this line is a blank line.
2013-01-29, 3003👍, 0💬

Web address URL validation
How to perform a validation on Web address URLs using a regular expression? For example, " http://regex.fyicenter.com/ " is a valid Web address URL. To perform a basic validation on Web address URLs, try this regular expression: ^https?:\/\/([A-Z0-9][-\w]*(\. [A-Z0-9][-\w]*)+):?(\d+)?\/?
2013-01-27, 3057👍, 0💬

US Social Security Number validation
How to perform a validation on US Social Security Numbers using a regular expression? For example, " 333-23-2329 " is a valid US Social Security Number. To perform a basic validation on US Social Security Numbers, try this regular expression: ^[\d]{3}-[\d]{2}-[\d]{4}$
2013-01-27, 3021👍, 0💬

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