The built-in Text channel will examine bulk text with Regex to extract results.
Steps
The steps you can use with Text fall into a single category: Text
Type | Name | Description |
---|---|---|
Text | ||
Action | Apply Regular Expression | Applies a regular expression on a text. |
Query | Find All Matches to a Regex | Applies a regular expression on all matches for this expression that don't overlap with other matches. |
Use case examples
The following are some examples of using the Text channel.
Email validation
This checks to see if a given string is a valid email:
^[^@ ]+@[^@ ]+\.[^@ \.]{2,}$
Date validation
This checks for a valid date format:
\d{4}-\d{2}-\d{2}
In this example, the code validates if given date string matches this pattern: YYYY–MM–DD, for example, 2019–12–18.
Credit card number validation
These chec for the correct format of different credit cards:
Visa: ^4[0–9]{12}(?:[0–9]{3})?$
American Express: ^3[47][0–9]{13}$
MasterCard: ^(?:5[1–5][0–9]{2}|222[1–9]|22[3–9][0–9]|2[3–6][0–9]{2}|27[01][0–9]|2720)[0–9]{12}$
Check document for emails
In this use case, whenever a record is created in Quickbase we can perform a check if it’s an email in the correct format and based on that we can do whatever we want, for example, we can send an email to an admin that we created a record with an incorrect format:
[A-Za-z0-9._%+-]+@[A-Za-z0-9.-]+\.[A-Z|a-z]{2,}
This checks for strings in the type of: xxxxxx@xxx.xx
or .xxx