Helpful Information
 
 
Category: Regex Programming
Regex Resources thread

As said...

Other forums on here have resources thread so why not put one here? Thought I'd just start this little thang up...I'll start us off

http://www.regular-expressions.info

The Jack-Daniels AddedBytes regex cheat sheet. (http://www.addedbytes.com/cheat-sheets/regular-expressions-cheat-sheet/)

If used correctly, that cheat sheet is all of the resources you will need. However, actually learning regex would be better :rolleyes:

I love the RegExp PowerToy (http://regex.powertoy.org/) for beginners, it really helps you see how the parsing is done. There's also a programmed called "RegExp Buddy" I think, but it's not freeware.

-Dan

The resource from which i learned :

PCRE Regular Expression Pattern Syntax Refference (PHP preg*) (http://www.regextester.com/pregsyntax.html)

PHP.NET


http://in2.php.net/manual/en/regexp.reference.php

:)

Thread stickied.

Regexp documentation for Perl:
perlre (http://perldoc.perl.org/perlre.html) - Regexp documentation
perlretut (http://perldoc.perl.org/perlretut.html) - Regexp tutorial

Regexp resources for Java are mostly contained in the Javadoc for the Pattern class (http://java.sun.com/j2se/1.5.0/docs/api/java/util/regex/Pattern.html)
There's also a Java Regex Tutorial (http://java.sun.com/docs/books/tutorial/essential/regex/index.html) available.

Other languages:

JavaScript (http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:RegExp)
VBScript (http://msdn2.microsoft.com/en-us/library/ms974570.aspx)

PHP PCRE Pattern Syntax Differences from Perl

PHP Regular Expressions (Perl-compatible) TOC

Software (Offline)
Windows-based Regex Tester/Builder: The Regex Coach (http://www.weitz.de/regex-coach/)
Windows-based .NET-specific Regex Tester/Builder: RegEx Designer (http://www.radsoftware.com.au/regexdesigner/)
Windows-based .NET-specific Regex Tester/Builder: Expresso (http://www.ultrapico.com/Expresso.htm)
Windows-based .NET-specific Regex Tester/Builder: The Regulator (http://sourceforge.net/projects/regulator/)
Windows-based .NET-specific Regex Tester/Builder:RegexDesigner.NET (http://www.sellsbrothers.com/tools/#regexd)
Visual Studio 2005 RegEx Visualizer (plug-in): Regex Kit (http://weblogs.asp.net/rosherove/archive/2005/11/26/AnnoucingRegexKit10.aspx)
OS X Dashboard Widget Regex Tester/Builder: RegexToolbox (http://www.apple.com/downloads/dashboard/developer/regextoolbox.html)

Online Testers
Rex V (http://rexv.org/)
A Better .NET Regular Expression Tester (http://derekslager.com/blog/posts/2007/09/a-better-dotnet-regular-expression-tester.ashx)

References
RegexAdvice (http://regexblogs.com/)
Regular Expressions in .NET (http://aspnet.4guysfromrolla.com/articles/022603-1.aspx)
RegexLib.com (http://regexlib.com/)
Regular Expressions User Guide (http://www.zytrax.com/tech/web/regex.htm)

Tutorials
Nice video tutorial (http://e-texteditor.com/blog/2007/regular_expressions_tutorial)
From Text Processing in Python (http://gnosis.cx/publish/programming/regular_expressions.html)

8 regular expressions you should know (http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/)

8 regular expressions you should know (http://net.tutsplus.com/tutorials/other/8-regular-expressions-you-should-know/)
An interesting link with good explanations. I'd have reservations about their email regexp though, as it disallows some valid characters.

Two JavaScript-oriented regular expression resources:


1) Just published today: http://net.tutsplus.com/tutorials/javascript-ajax/you-dont-know-anything-about-regular-expressions/

2) http://www.javascriptkit.com/javatutors/redev2.shtml

If you're working with regular expressions in .NET, may I suggest:

- Online .NET regex tester (http://regexstorm.net/Tester.aspx)
- Online .NET regex reference (http://regexstorm.net/Reference.aspx)

And yes, Regex Storm (http://regexstorm.net) is my site. :D

RegexPal saves my life on a daily basis.

RegexPal.com (http://www.regexpal.com/)

This set of Perl one-liners (http://www.catonmat.net/download/perl1line.txt) is fascinating and useful. Many of them are not purely regex based, but there are still good things in there.

-Dan

May I ask what resources you'd recommend for learning more?
Second time (http://forums.devshed.com/regex-programming-147/match-multiple-versions-of-city-names-873694.html) I get this question this week, so to save fingers I thought I'd consolidate my answer on this thread. :)
Much of what was said above is still true, but resources change and tastes vary, so here is my take.

A. Online Resources

1. Starting out: Jan's tutorial (http://www.regular-expressions.info) is a great place to start. Jan is the author of beautiful regex software (see section B) and a regex book (see section C). He knows his subject.

2. Learning more: Once you know the very basics, in my view, this Regex Tutorial (http://www.asiteaboutnothing.net/c_regex.html) is the best place to go for both basic and advanced syntax. I wrote it, so I am biased. Judge for yourself. :) The page is huge and has a different approach. Instead of repeating the regex ABC you will find all over the blogosphere, this tutorial tries to cut diagonally, going to the questions you ask yourself when crafting expressions. For instance, there is a whole section just to disambiguate the many forms of (? syntax. A section about whether to capture or to match. About the various contexts where regex will be useful. About conditionals. Etc.
There is also a second tutorial dedicated to a little-documented feature of PHP regex: Recursive Regex (http://www.asiteaboutnothing.net/c_regex-recursive.html).

3. Grand Master: the PCRE manual. No, I don't mean the PHP manual's section on PCRE (http://php.net/manual/en/book.pcre.php), although that document is often helpful if you code in PHP. I mean the manual to the PCRE engine (http://www.pcre.org/pcre.txt), a manual written by Philip Hazel, the creator of PCRE. It goes into the engine to a level of detail that PHP regex fans will love. Others will find it over the top.

B. Tools

For me, there is only one tool: RegexBuddy. RB, as this tool is known by its fans, is an all-in-one expression crafter and debugger written by Jan Goyvaerts, the author of the tutorial mentioned in section A.1. Here is an automatically updated link to the latest RegexBuddy demo (http://yu8.us/rbdemo).

RB "understands" many flavors of regex: PCRE, Java, Python, etc. At the simplest level, it's a three-box interface. In one box, you craft your expression. In the second box, you paste your test strings. In the third box, you automatically see the matches and captures. There is a "Use" function that adapts your regex to the functions of your programming language: VB.Net, PHP, Java etc. And many other powerful functions.

RegexBuddy is powerful, but you have to set it up right, and the power doesn't jump at you when you first install it, as the interface looks innocently simple. See my quick guide to RegexBuddy (http://www.asiteaboutnothing.net/c_regex.html#tools) for set-up tips and a tour of the interface.

C. Books

O'Reilly has three regex books. I like two of them: Jan's cookbook, and Jeffrey's Mastering Regex book. If you pick just one, I would recommend Jeffrey's, though it is short on certain topics. I have tried hard to plug the holes in both of these books in my regex tutorial---see section A.2 above on this thread.

The bottom line is that to learn something, you want to go at it from different directions, so I would highly recommend picking up at least one of these books.
I don't want to repeat myself, so for more information about these regex books (and others that I don't recommend), please see my review of Regex books (http://www.asiteaboutnothing.net/c_regex.html#bookreview).

D. Practice

You know it, practice makes perfect. You can read and read, but until you put your fingers to the keyboard, your knowledge of regex will be secondhand. Two places to practice:

1. Your own code. This goes without saying.

2. The DevShed regex forum! Your code will probably not expose you to all the aspects of regex in a short period of time. But the posts on this forum will. And there are many experienced regex practitioners here from whom you can pick up things that may not jump at you right away---this happens to me, and I love it. We all learn from one another.

Okay, folks... I could go on, but if you use the resources mentioned on this post, you'll be busy for quite a while. By that point, any other resource I could mention at this stage will be (for 90% or more) a repetition of things you already know.

Wishing you lots of fun you your regex journey,

Smiles,

-Andy

I started a new website that will collect solutions to the most frequently encountered regex problems. My first articles are written.

Regex for Numbers (http://regex-for.com/number/) discusses regular expressions for various kinds of numbers (integers, decimal fractions, e notation).
Regex for IP Addresses (http://regex-for.com/ip/) shows how IPv4 and IPv6 addresses can be matched with regular expressions.
Regex for NOT, AND, OR (http://regex-for.com/not-and-or/) shows how logical operators can be implemented within regular expressions and introduces positive and negative look-ahead assertions.

Have a look at my mascot - it's Tyrannosaurus Regex! ;)

A good one for newbies who like to actually practice what you read (and since Linux documentators (documentarians?) seem to have an example-phobia, that's all of us): http://regexone.com/lesson/0

(Can a more senior member please make that URL into a link?)

toolregex.com
This page exact test and easy to use. I often use this site to test. It has both javascript and php. And has to the design mode

Excellent help is regex101.com wich provides flavors, syntax analytics, match info and a quick refrerence...

Nobody have posted here for a while, but anyways.
I have implemented yet another regex helper which visualizes it: Regex online tester and visualizer (http://preg.pro/)
There is a "syntax tree" tool that shows the structure of the regex, the "explaining graph" tool that shows alternative paths in the regex, and, as usual, a testing tool to test regex on strings.
Hope this helps somebody.










privacy (GDPR)