Regex Resources
Many internet resources to learn and practice regular expressions.
Javascript Regex vs Standard PCRE
PCRE stands for “Perl Compatible Regular Expression”. It is a standardization of an enhanced kind of expression matching that started with the Perl language.
The regex tutorials are very good but use slightly “nonstandard” regular expression rules (Javascript not PCRE).
Notes:
- Normal PCRE backreferences (referring to the match made by a
previous group) are done with a backslash in front, like
\1
refers to group 1. This is different from Javascript, where the same backreference is$1
. - We will not have use for lookahead like
(?! ...)
or(?= ...)
.
Resource Links
- Learn Regular Expressions in 20 Minutes
- Regex Tutorials has a lot of good material and exercises. It is my favorite.
- Decent but retro Regex Buddy. Includes more examples than other sites.
- Video: RegEx in 100 seconds - not as good as the 20 minute version.
- PCRE Cheatsheet
- Regex Golf - Gets hard too fast to use for learning. The first few are good, though.
- Regex Crossword
- RegExr - visualizes matches. Possibly an interesting tool for learning. You have to supply your own words to match against.
- Debuggex regex tester is similar to RegExr.
- Technical pcrepattern man page. Includes things like
(*UCP)
to turn on the use of Unicode properties for\w
and\d
.