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

PHP Regular Expressions (Perl-Compatible)
I am using regular expressions in PHP scripts and need to look at reference document frequently. If you are writing PHP scripts and using regular expressions, you need to bookmark this PHP official reference document: "Regular Expressions (Perl-Compatible)" . Topics covered in "Regular Expressions (...
2013-01-22, 3380👍, 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, 3339👍, 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, 3321👍, 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, 3297👍, 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, 3281👍, 0💬

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

Capturing fragment id from URL
How to capture fragment id 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, 3220👍, 0💬

Capturing user agent from Apache Web log file
How to capture the user agent from Apache Web log file? Here are some Apache Web log file entries: 127.0.0.1 - frank [10/May/2012:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326 "-" "-" "-" 213.135.131.79 - - [13/May/2012:17:35:32 -0600] "POST /submit.jsp HTTP/1.0" 200 1024 "-" "-" "SID=1000;...
2013-02-04, 3169👍, 0💬

Capturing referer URL from Apache Web log file
How to capture the referer URL from Apache Web log file? Here are some Apache Web log file entries: 127.0.0.1 - frank [10/May/2012:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326 "-" "-" "-" 213.135.131.79 - - [13/May/2012:17:35:32 -0600] "POST /submit.jsp HTTP/1.0" 200 1024 "-" "-" "SID=1000...
2013-02-04, 3168👍, 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, 3162👍, 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, 3153👍, 0💬

Capturing cookie string from Apache Web log file
How to capture the cookie string from Apache Web log file? Here are some Apache Web log file entries: 127.0.0.1 - frank [10/May/2012:13:55:36 -0700] "GET /apache_pb.gif HTTP/1.0" 200 2326 "-" "-" "-" 213.135.131.79 - - [13/May/2012:17:35:32 -0600] "POST /submit.jsp HTTP/1.0" 200 1024 "-" "-" "SID=10...
2013-02-04, 3136👍, 0💬

Capturing scheme name from URL
How to capture scheme name from URL addresses with a regular expression? Here are URL address examples: ftp://asmith@ftp.example.org https://login.example.com:5800 /http://en.wikipedia.org/wiki/W WW.html#Historyfile://localhost/c|/WINDOWS/cl ock.aviURL addresses are written in this format: scheme://...
2013-02-03, 3127👍, 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, 3114👍, 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, 3110👍, 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 c...
2013-02-03, 3076👍, 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, 3071👍, 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, 3060👍, 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 a...
2013-02-03, 3052👍, 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, 3036👍, 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, 3012👍, 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, 2999👍, 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, 2997👍, 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, 2989👍, 0💬

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