开发者

php regular expressions resources

can somebody poi开发者_Python百科nt 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 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)


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜