<< < 1 2 3   Sort: Rank

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, 2873👍, 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, 2751👍, 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, 3067👍, 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, 4075👍, 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, 2829👍, 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, 2926👍, 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, 2947👍, 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, 2921👍, 0💬

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, 7214👍, 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, 3191👍, 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, 2884👍, 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, 2978👍, 0💬

Diners Club credit card number validation
All credit card numbers issued by Diners Club must start with 300 through 305, 36 or 38 and have 14 digits. For example, 38520000023237 is a valid Visa credit card number. How to write a single regular expression to validate a Diners Club credit card number described above? Here is the regular expre...
2013-01-22, 17601👍, 0💬

MasterCard credit card number validation
All credit card numbers issued by MasterCard must start with 51 through 55 and have 16 digits. For example, 5271190242643112 is a valid MasterCard credit card number. How to write a single regular expression to validate a MasterCard credit card number described above? Here is the regular expression ...
2013-01-22, 9449👍, 0💬

American Express credit card number validation
All credit card numbers issued by American Express must start with 34 or 37 and have 15 digits. For example, 346997719493686 is a valid American Express credit card number. How to write a single regular expression to validate a American Express credit card number described above? Here is the regular...
2013-01-22, 9337👍, 0💬

Visa credit card number validation
All credit card numbers issued by Visa must start with a 4 and have 13 or 16 digits. For example, 346997719493686 is a valid Visa credit card number. How to write a single regular expression to validate a Visa credit card number described above? Here is the regular expression for Visa credit card nu...
2013-01-22, 4204👍, 0💬

<< < 1 2 3   Sort: Rank