Projects
The Origin Creator On Command Timely Music
Madad Maps fpclib Documentation
Flashpoint Work Minecraft Work Origins Work Vintage Story Work Python Work Linux Stuff
Odds & Ends All
Help
Origins - Flow Help
Don't Ask to Ask Be Direct Be Specific Be Patient Deep End Teaching
What is Regex? JSON Format Show File Extensions
.minecraft Folder Minecraft - Logs Origins - Click Links Origins - Pehkui Origins - Do Research
Support me on
Ko-Fi or Patreon!

What is Regex?

Regex is a special format for characters used for searching for, matching, and perhaps replacing, text.

Regex is often used in places where the text you want to find/match doesn't always contain the same characters, but follows some kind of pattern. For example, if you want to search for/match emails or phone numbers; no email or phone number is the same, but they all follow the same pattern. In fact, a sequence of regex characters is known as a "pattern", probably for that very reason.

For writing and testing regular expressions, I recommend using regex101.com, but here's a few examples (clicking on any regex will send you to a specific regex101 test page) for you to learn from.

There are many more features of regex that aren't listed here, and some languages do not even support some of the more extensive features or regex. To learn more about the features at your disposal, look at the items in the "Quick Reference" panel in the bottom right of regex101.com. You can click on any of the items to view a short example of it working.

PatternDescription
textMatches the literal text "text".
ba+Matches any sequence of a "b" followed by 1 or more "a"s.
lo*Matches any sequence of a "l" with 0 or more "o"s.
\d+Matches any sequence of one or more numbers.
[abc]+Matches any sequence of the letters "a", "b", and "c".
[a-z]+Matches any sequence of lowercase letters.
[a-z]+\d+Matches any sequence of lowercase letters followed by numbers.
(bob)+Matches any sequence of the word bob individually or repeated.