Complete Guide to Building a Chatbot using Flow Builder and Setting Up Catalogs
Regular Expressions, commonly abbreviated as Regex, are sequences of characters that define a search pattern. They are used extensively in programming, data validation, search operations, and text processing.
| Symbol | Description |
|---|---|
| . | Matches any character except a newline |
| ^ | Anchors the match at the beginning of a string |
| $ | Anchors the match at the end of a string |
| * | Matches 0 or more repetitions |
| + | Matches 1 or more repetitions |
| ? | Matches 0 or 1 occurrence |
| [] | Matches any one character within the brackets |
| [^] | Matches any character not in the brackets |
| {n} | Matches exactly n occurrences |
| {n,} | Matches at least n occurrences |
{n,m} |
Matches between n and m occurrences |
| Class | Matches |
|---|---|
| \d | Any digit (0-9) |
| \D | Any non-digit |
\w |
Any word character (alphanumeric + underscore) |
| \W | Any non-word character |
| \s | Any whitespace character |
| \S | Any non-whitespace character |
^[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-z]{2,}$
Matches: [[email protected], [email protected]](https://[email protected], [email protected])
\d+
Matches: Any sequence of digits like 123, 45678
^[6-9]\d{9}$
Matches: 9876543210, 9123456789
^[A-Z]{5}[0-9]{4}[A-Z]{1}$
Matches: ABCDE1234F
^(0[1-9]|[12][0-9]|3[01])[-/](0[1-9]|1[0-2])[-/](19|20)\d{2}$
Matches: 21-04-2025, 01/01/2000
\b(interested|purchase|buy)\b
Matches: Any standalone occurrence of "interested", "purchase", or "buy" (e.g., "I am interested", "ready to purchase", "want to buy")
.* or ^.*$
Matches: Any message or any sequence of characters
Use this when you want to match any input message without restriction.
To fully unlock the power of regex, it's encouraged to explore more through hands-on practice and self-research. Many complex patterns and use cases can be discovered by experimenting and searching specific scenarios online.