Table of Contents

Formulas - Regex

Sofia Teran Updated by Sofia Teran

Formulas available

  • RegexText

RegexTest

Check for numbers of 11 digits
  1. Add a text block instead of a number block
  2. Save the variable
  3. Add a Formula block 
  4. Choose the RegexTest Formula and copy this: RegexTest(/^\d{11}$/, @code_number)  You can edit this number {11} according to your needs, and the @code_number will be the variable that you saved in the text block. 
  5. Don't forget to save the variable of the Formula block on the output "True/False"

RegexTest(/^\d{11}$/,@code_number)

You'll be able to set in the builder bot:

  • The True output (green arrow) to confirm the user that the number is in the correct format and with the correct number of digits.
  • The False output (red arrow) to send a message explaining that it's incorrect and connect this message with the text block to start the flow again (asking for the number). 

Check if the input is a valid UK postal code
RegexTest(/([A-PR-UWYZ][A-HK-Y0-9](?:[A-HJKS-UW0-9][ABEHMNPRV-Y0-9]?)?\s*[0-9][ABD-HJLNP-UW-Z]{2}|GIR\s*0AA)/,@text)

Check if the input contains a word that is "stop" or something that starts with "stop"

RegexTest(/^stop.*/,@text)

How did we do?

Formulas - Comparison

Formulas - Math

Contact