tags:

views:

53

answers:

5

Hi all , can somebody point me to a good regular expression resource (for php if it matters). I am looking now for a book here amazon but don't know which one is better. It would be great to find something simple to understand and a fast and interesting process of learning.

+2  A: 

You can start at http://www.regular-expressions.info/

The site also has a list of regular expressions books.

PHP supports several regular expressions variants, but the most important is PCRE (perl-comptabible regular expressions).

The mb_ereg family, besides supporting several encodings, also supports several variants:

j   Java (Sun java.util.regex)
u   GNU regex
g   grep
c   Emacs
r   Ruby
z   Perl
b   POSIX Basic regex
d   POSIX Extended regex
Artefacto
+1 for regular-expressions.info
jasonbar
+1 but even though , I also asked maybe somebody know an interesting resource, I mean with some interesting examples, situation. http://www.regular-expressions.info/ seems a bit complicated for beginners, or maybe I am wrong.
Centurion
@Vad I think [the tutorial](http://www.regular-expressions.info/tutorial.html) is pretty accessible for beginners.
Artefacto
Regular-expressions.info is designed _for_ beginners. You're not going to find any resource that breaks it down simpler than that. Just take the time to do their tutorial from start to finish, and you'll have a good grasp of regular expressions.
Lèse majesté
+1  A: 

Mastering Regular Expressions by: Jeffrey E.F. Friedl is considered the bible of Regular Expressions books.

Also, as Artefacto mentioned: http://www.regular-expressions.info/ is a terrific resource with clear and simple explanations.

But the best way to learn is to play with them using a regex tool like Reggy (Mac tool)

Brian Wigginton
+1  A: 

Along with http://www.regular-expressions.info, you might find it useful to get an interactive regex editor.

The Regex Coach is a good, light-weight editor.

RegexBuddy is amazing, but costly.

regexpal.com a simple, online tester.

jasonbar
+1  A: 

This is the only place I've found an intro to regular expressions that's suitable for beginners. It's part of an online book called "Practical PHP".

http://www.tuxradar.com/practicalphp/4/8/0

Lotus Notes
+1  A: 

These are the only regex books you'll ever need:

Mastering Regular Expressions

Regular Expressions Cookbook

Both are great tools for learning regexes in general, but they both have lots of information specific to PHP as well.

Alan Moore