How to block mobile numbers in chat

Hi All

I am having a little issue with the chat in my app. It is a tutoring app that allows chat between tutor & client. Some of them are exchanging mobile numbers & email addresses. This will allow them to bypass the app & make arrangements without paying. Is there a way to block mobile numbers & email addresses?

Best Regards

Jay

Hi Jay,

I think you could use NoCode Monkey’s regex component with something like this! : ^(?![\s\S]*(\+?[0-9][\d\s\-\(\)]{5,}[0-9]|\S+@\S+\.\S+))[\s\S]*$

I was also thinking to use replace text endpoint that is available in Function Hub (Function Hub | Adalo Resources) but then realized it can remove one search term per API call. I’ve noted this to share with the team so something like enhancing this endpoint to support multiple search terms and possibly able to map a regex code would be great! :raising_hands:

Or you could use a 3rd party integration like MAKE.

Thank you and have a great day!

Hey @eduscvs

I saw this and thought it was a great use case — I actually just added an API endpoint to Vibe API Hub that solves this directly without needing a regex component.

The endpoint: POST /text/regex/replace

It takes your message text, runs a regex pattern against it, and returns the cleaned version with phone numbers and emails replaced before you store it.


How to set it up in Adalo:

  1. Create a Custom Action on your send message button (runs before the message is saved)

  2. Set the method to POST and the URL to:

    https://vibe-api-hub.vercel.app/text/regex/replace

  3. Use this as the request body — map text to your message input magic text:

    {

    “case_insensitive”: true,

    “multiline”: false,

    “pattern”: “(\\+?[0-9][\\d\\s\\-\\(\\)]{5,}[0-9]|\\S+@\\S+\\.\\S+)”,

    “replacement”: “[REDACTED]”,

    “text”: “YOUR MESSAGE MAGIC TEXT HERE”

    }

  4. The API returns a result field — use that as the value you save to the database instead of the raw input

This pattern catches both phone numbers and email addresses in a single call. So something like:

“Hi, call me on 0712 345 678 or email jay@example.com”

becomes:

“Hi, call me on [REDACTED] or email [REDACTED]”

You can swap [REDACTED] for *** or just "" to remove them entirely — whatever fits your app’s tone.

Full docs and interactive tester here (you can try it live before wiring it up): :backhand_index_pointing_right: https://vibe-api-hub.vercel.app/docs#/Text%20Utilities/regex_replace_text_regex_replace_post

It’s free, no auth needed. Hope it helps! :raising_hands:

2 Likes

Sounds good @Jeorge, thanks for sharing! Is there any rate limits included in the endpoints? Thank you and have a great day!

Great question @Dilon, right now there are no rate limits set on the API itself, so you can call it freely.

The one natural constraint is that it’s hosted on Vercel’s free tier, which has a soft limit of 100GB bandwidth/month and 100,000 function invocations/month across all users. For utility calls like these that’s a very high ceiling and realistically won’t be hit anytime soon.

If usage ever gets to a point where limits become a concern I’ll look at adding proper rate limiting, but for now, use it freely! :blush:

1 Like