< 1 2 3 >   Sort: Rank

Capturing authenticated user name from Apache Web log file
How to capture the authenticated user name 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 - - [15/May/2012:19:21:49 -0400] "GET /features.htm HTTP/1.1" 200 9955 "http...
2013-02-03, 2010👍, 0💬

Capturing timestamp from Apache Web log file
How to capture the timestamp 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 - - [15/May/2012:19:21:49 -0400] "GET /features.htm HTTP/1.1" 200 9955 "http://www.abc.com...
2013-02-03, 2664👍, 0💬

Capturing host name from Apache Web log file
How to capture the remote host name 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 - - [15/May/2012:19:21:49 -0400] "GET /features.htm HTTP/1.1" 200 9955 "http://www....
2013-02-03, 1990👍, 0💬

Parsing all elements of URL addresses
How to parse out all elements 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 ...
2013-02-03, 2088👍, 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 add...
2013-02-03, 2109👍, 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, 2080👍, 0💬

Capturing path name from URL
How to capture path name from URL addresses with a regular expression? Here are URL address examples:ftp://ftp.example.org /https://login.example.com:5800 /?mode=guesthttp://www.google.com:80/api/e xample/submit.php?name=joe#newfile://localhost/c|/WINDOWS/do cument.html#chapter1URL addresses are wri...
2013-02-03, 2530👍, 0💬

Capturing port number from URL
How to capture port number from URL addresses with a regular expression? Here are URL address examples:ftp://ftp.example.org https://login.example.com:5800 /http://en.wikipedia.org:80/wik i/WWW.html#Historyfile://localhost/c|/WINDOWS/cl ock.aviURL addresses are written in this format: scheme://domai...
2013-02-03, 1930👍, 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.exam ple.orghttps://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://d...
2013-02-03, 2252👍, 0💬

Capturing domain name from URL
How to capture scheme name from URL addresses with a regular expression? Here are URL address examples:ftp://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://domain:p...
2013-02-03, 1984👍, 0💬

Finding repeating words in a document
How to find repeating words in a text document with a regular expression? An example text document is listed below:After narrowly escaping a sensitive decapitation, Bond Bond is shot with a tranquilizer gun. He wakes up up on a plane to a woman standing over him, who introduces herself: "My name is ...
2013-02-03, 1925👍, 0💬

Capturing attributes of XML elements
How to capture attributes of XML elements in XML documents? An example XML document is listed below: The regular expression to capture attributes of XML elements in an XML document can be written as: ([^\s=]+)\s*=\s*"((?:[^"]*\")* [^"]*)"Note that: ([^\s=]+) - Attribute name ((?:[^"]*\")*[^"]*) - At...
2013-02-02, 1981👍, 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 c...
2013-02-02, 2289👍, 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; Th...
2013-02-02, 1967👍, 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 PM...
2013-02-01, 3143👍, 0💬

Parsing key-value entries from Windows .INI files
How to write a regular expression to parse key-value entries from Windows .INI files? Here is an example Windows .INI file, system.ini:; for 16-bit app support [386Enh] woafont=dosapp.fon EGA80WOA.FON=EGA80WOA.FON EGA40WOA.FON=EGA40WOA.FON CGA80WOA.FON=CGA80WOA.FON CGA40WOA.FON=CGA40WOA.FON [drivers...
2013-02-01, 4152👍, 0💬

Validating GUID or UUID
How to write a regular expression to validate GUID (Globally Unique IDentifier) or UUID (Universally Unique IDentifier)? Here is a list of good and bad GUID examples:{D1A5279D-B27D-4CD4-A 05E-EFDD53D08E8D}{594ABD08-C02C-4827-8ABF-A1280 06848A3}{B59511BD6A5F4DF09ECF562A108D8 A2E}69593D62-71EA-4548-85...
2013-02-01, 12675👍, 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, 2523👍, 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, 2134👍, 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 1...
2013-02-01, 2981👍, 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, 2077👍, 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, 2207👍, 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, 2043👍, 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, 1994👍, 0💬

< 1 2 3 >   Sort: Rank