Salebot.ai
  • About
  • The basics: How to use Salebot.ai
    • The basics of using the editing software
    • Creating blocks and the types of them
    • Arrows (connections)
    • Quick actions
    • Buttons
    • Condition and Matching selection
    • Links to messengers
    • Blocks "not State"
    • The first message
    • Description of the fields in the Editor
    • How to make the bot not interrupt the dialogue with the client
    • Sending attachments. Tracking links.
    • Getting files from the user
    • Editing text message
    • Random answers in a bot
    • Built-in variables
    • Reservation and recovery
    • Free Videos to master Salebot
  • Administration
    • Custom Roles
    • Reservation and recovery
  • Messengers and chats
    • WhatsApp
    • Whatsapp Business API
    • Telegram
    • Viber
    • Facebook Messenger
    • Official Instagram
    • Online-chat on a site
    • Merging contacts from different messengers
  • Variables
    • Variables
    • Calculator
    • API in Calculator
    • Variable comparison
    • Working with Dates and Time
    • Working with Arrays and Dictionaries
    • List of Useful Regular Expressions
    • How to use variables
  • CRM
    • AmoCRM
    • Bitrix24
  • Working with API
    • The editing software's API
    • Integration with third-party APIs
  • Integrations
    • Payment systems
      • Capusta.space
      • Coinpayments
      • INXY Payments
      • Paypal
      • Payeer.trade
      • Paynow
      • Stripe
      • Telegram
      • Fondy
      • Wayforpay
      • WalletOne
    • InfoBusiness
      • MyOwnConference
      • WebinarGeek
    • Analytics
      • Roistat
      • Facebook Pixel
      • Google Analytics
    • Google Sheets
    • Google Tables
    • Google Calendar
    • Apix-Drive
    • SMS services
    • Sendpulse
    • QuizGO
    • Tilda
    • Linkrr
    • Vakas-Tools
  • Mailings
    • Pipelines
    • Manual mailings
    • Mailing list
    • Stop mailing
    • How to filter clients for mailing
    • Transferring the client base. Uploading Whatsapp numbers
  • To partners
    • How to transfer the project to the customer
  • How to...
    • FAQ
    • ...Create a simple chatbot
    • ...Transfer UTM-labels
    • ...Create a referral program
    • ...Create temporarily available content
    • ...Connect analytics counters and configuring conversions through GTM
    • ...Move clients to another block
    • ...Create personalized images
    • ...Create a menu in Telegram
    • ...Connect Telegram-pay
  • Payment Services
    • Page 1
  • Mini-landing
  • Special capabilities
    • Python programming
    • Generating a QR-code
    • Generating a barcode
    • Barcode recognition on an image
    • Using Google Sheets for mailings
    • Sending requests to messengers and email
    • Working with promo codes
  • Our services
    • Pricing
    • Training courses
  • Group 1
Powered by GitBook
On this page
  1. Variables

List of Useful Regular Expressions

If you need to check whether a person has entered a phone number or something else correctly, you can use regular expressions.

PreviousWorking with Arrays and DictionariesNextHow to use variables

Last updated 3 years ago

Regular expressions are a condition by which a bot can check the format of the input data (for example, that a person has entered a phone number instead of something else)

For comparison by regular expression, the type of comparison should be put "Regular expression".

Regular expressions are written into condition, not variables for comparison!

When collecting data, the user often enters not what he is asked to enter. I will provide a typical scheme to check the correctness of the input of the phone number. In case the user has not entered the phone number, the bot will ask him to repeat the input.

From the block asking for the phone number there are 2 connections. One without the condition, and the second with the condition of regular expression of the Russian phone number: (( +7|7|8)+([0-9]){10})$ A connection to a condition just adds it to the application and will work only when the correct phone number is encountered. The second connection will work in all other cases because it has a lower priority. On the second connection, the user will be told that he entered incorrect data, and will send back to enter the phone number.

List of useful regular expressions

  • Enter only numbers: [1-9]+[0-9]*$

  • Credit card number: [0-9]{13.16}

  • ICQ: ([1-9])+(?:-? d) {4,}

  • Phone number ( +)? (( d{2.3}) ? d| d)((([ -]? d)|( ?( d{2.3})?)){5.12} d$

  • Name+First name or full name [A-YA-YAYUA-ZA-Z]+ [A-YAYA-YAYUA-ZA-Z]+ ? [A-YAYA-YAYUA-ZA-Z]+$

  • Set of letters and numbers (Latin): [a-zA-Z0-9]+$

  • Set of letters and numbers (Latin + Cyrillic): [A-YA-YAYUA-Z0-9]+$

  • Domain (for example abcd.com): ([a-zA-Z0-9]([a-zA-Z0-9 -]{0.61}[a-zA-Z0-9])? .)+[a-zA-Z]{2.6}$

  • URL (for example abcd.com): (https?): (((//)|( ))[ w:#@%/;$()~? + -= . &]*

  • IPv4: (25[0-5]|2[0-4] d|[01]? d?) .){3}(25[0-5]|2[0-4] d|[01]? d?)

  • IPv6: (( |:)([0-9a-fA-F]{0.4})){1.8}$

  • User name (with a limit of 2-20 characters, which can be letters and numbers, the first character is required letter): [a-zA-Z][a-zA-Z0-9- . ]{1.20}$

  • Password (Lowercase and uppercase Latin letters, numbers): (?=.* d)(?=.[a-z])(?=.[A-Z])(?!.* s). *

  • Password (Lowercase and uppercase Latin letters, numbers, special characters. Minimum 8 characters): (?= .{8,}$) (((?=.* d)|(?=.* W+))(?!![. n])(?=.[A-Z])(?=.[a-z]). *$

  • Date in YYYY-MM-DD format: [0-9]{4}-(0[1-9]|1[012])-(0[1-9]|1[0-9]|2[0-9]|3[01]) UPD. Stricter check: (19|20) d-((0[1-9]|1[012])-(0[1-9]|[12] d)|(0[13-9]|1[012])-30|(0[13578]|1[02])-31)

  • Date in DD/MM/YYYY format: (0[1-9]|[12][0-9]|3[01]) - /.- /- . d Date in DD.MM.YYYY format: (0?[1-9]|[12][0-9]|3[01]).(0?[1-9]|1[012]). ((19|20) d)

  • Integers and floating-point numbers (dot delimiter): -? d+( . d{0,})?

  • UUID: [0-9A-Fa-f]{8} -[0-9A-Fa-f]{4} -[0-9A-Fa-f]{4-[0-9A-Fa-f]{12}

  • Latitude or longitude: -? d{1.3} . d+UPD. E-mail: [- w. ]+@([A-z0-9][-A-z0-9]+ .)[A-z]{2.4}$

  • UPD. URL in Latin. If you need to recognize and Cyrillic domains, it is necessary to change all «a-z0-9» to «a-yayoa-z0-9» and add to the list of domain zones «Russian»: ~^(?:(?:https?|ftp|telnet):/(?:[a-z0-9_-]{1.32}(?::[a-z0-9_-]{1.32})?)? (??(?:[[a-z0-9-]{1.128} .)+(?:ru|su|com|net|org|mil|edu|arpa|gov||info|aero||aero|||||aero|name|[a-z]{2})|(!0.]?????? $~i

  • UPD. Time in HH:MM:SS format: ([0-1] d|2[0-3])(:[0-5] d) {2}$

  • UPD. Mac address: ([0-9a-fA-F]{2}([:-]|$)){6}$|([0-9a-fA-F]{4}([.]|$)){3}

There are a lot of regular expressions, if you do not find the right ones in this list, you should consult the search engines.

Testing regular expressions is convenient on the site: https:/regex101.com/