Practice
Learn
- RegexOne - Learn Regular Expressions - Lesson 1: An Introduction, and the ABCs
- Regular-Expressions.info - Regex Tutorial, Examples and Reference - Regexp Patterns
Tools
- Debuggex: Online visual regex tester. JavaScript, Python, and PCRE.
- Regex denial of service checker
- random data from regex
- Regexper
- The images generated by Regexper are commonly referred to as âRailroad Diagramsâ. These diagram are a straight-forward way to illustrate what can sometimes become very complicated processing in a regular expression, with nested looping and optional elements. The easiest way to read these diagrams to to start at the left and follow the lines to the right. If you encounter a branch, then there is the option of following one of multiple paths (and those paths can loop back to earlier parts of the diagram). In order for a string to successfully match the regular expression in a diagram, you must be able to fulfill each part of the diagram as you move from left to right and proceed through the entire diagram to the end.
Find âwordâ not followed by a certain character
The (?!@)
negative look-ahead will make word
match only if @
does not appear immediately after word
:
Test
word
worda
word@
worda@