These examples are for the regular expression enthusiasts out there.
Regular Expression 101 | Advanced Regex Patterns | Regex and PythonRegular Expression 101
Learn the basics, the fun way!
This page contains a simple example:
import re
match = re.search('Hello, world!', 'Hello, world!')
print(match.group())
A regular expression is a sequence of characters that defines the rules for a particular search pattern in text.
For example, the pattern 'Hello, world!' matches 'Hello, world!'.
Want to learn more? Visit our Regular Expression Basics page for more information.
Advanced Regex Patterns
Take your regex skills to the next level!
This page contains some advanced regex patterns for you to try:
import re
match = re.search('123-456', '123-456')
print(match.group())
This pattern uses the '-' character as a literal character in the search pattern.
Want to learn more? Visit our Advanced Patterns page for more information.
Regex and Python
Use regular expressions in Python for fun and profit!
This page contains a simple example of using regex in Python:
import re
match = re.search('123-456', '123-456')
print(match.group())
This pattern uses the 're' module in Python to search for the pattern '123-456'.
Want to learn more? Visit our Advanced Regex in Python page for more information.