简体   繁体   中英

php regular expressions resources

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.

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

Mastering Regular Expressions by: Jeffrey EF 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)

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.

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

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM