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

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, 2395👍, 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, 2380👍, 0💬

JRegexpTester
What functions are offered by JRegexpTester? JRegexpTester is a standalone Swing application that helps you test regular expressions with the Sun Java standard API (java.util.regex). The extracted data can be modified with formatters similar to those used by sprintf, or with standard Java date and d...
2013-01-25, 2367👍, 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 ne...
2013-01-23, 2344👍, 0💬

Discover credit card number validation
All credit card numbers issued by Diners Club must start with 6011 or 65 and have 16 digits. For example, 6011186767363105 is a valid Visa credit card number. How to write a single regular expression to validate a Discover credit card number described above? Here is the regular expression to validat...
2013-01-22, 2336👍, 0💬

Using character range in a character classe [a-z]
What is a character range in a character class? How to specify a character range in a character class in a regular expression? I have a string of hexadecimal digits, 46594963656E7465722E636F6D and want to use character ranges in a character class to validate it. A character range defines a set of po...
2013-01-22, 2333👍, 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, 2324👍, 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) with...
2013-01-26, 2317👍, 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 o...
2013-01-23, 2309👍, 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, 2307👍, 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, 2302👍, 0💬

Logical OR (Alternation) operation (a|b)
What is a logical OR operation? How to specify a logical OR operation in a regular expression? How to use logical OR operations to build a regular expression to search and count common spamming terms from this email paragraph: I am inviting you for a business deal where this money will be shared bet...
2013-01-22, 2291👍, 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, 2278👍, 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, 2278👍, 0💬

Capturing query string from URL
How to capture query string from URL addresses with a regular expression? Here are URL address examples:ftp://ftp.example.org /https://login.example.com:5800 /?mode=guest&lang=enhttp://www.google.com:80/api/e xample/submit.php?name=joe#newfile://localhost/c|/WINDOWS/do cument.html#chapter1URL ad...
2013-02-03, 2275👍, 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 dae...
2013-02-02, 2273👍, 0💬

Case insensitive modifier - i
What is case insensitive modifier? How to use it? How to write a regular expression to capture the "DIM" key word from this code example:Dim intArray(10, 10, 10) As Integer ReDim Preserve intArray(10, 10, 20) ReDIM Preserve intArray(10, 10, 15) Redim intArray(10, 10, 10) The regular expression to ca...
2013-02-03, 2262👍, 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, 2261👍, 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, 2253👍, 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, 2251👍, 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, 2247👍, 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, 2243👍, 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 of...
2015-05-22, 2233👍, 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, 2230👍, 0💬

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