Skip to content

Regex Regular Expression Snippets

Terminal window
# Match 1 or many characters
.+
# Match any characters
.
# Match digits (numbers)
\d
# Match words
\w
# Match 1 or more word
\w+
# Match 1 or more digits
\d+
# Match only 1 character in the given set
[abc]
# Match to a, b, or c
# Search for the words "apple" and "banana" in any order
^(?=.*apple)(?=.*banana).*
# search for apple, banana and/or cherry in any order
^(?=.*apple)(?=.*banana)(?=.*cherry).*