Skip to main content

Regular Expressions | How to Insert Hyphens in Phone Numbers

Yoom Customer Service avatar
Written by Yoom Customer Service
Updated this week

📝 Overview

This guide will show you how to insert hyphens in continuous mobile phone numbers using regular expressions.

☝️ Note:

This method works for mobile numbers only, not landline numbers.


📍 Strings & Actions to Use

  • Output: A continuous mobile phone number that you want to format with hyphens.

  • Action: Use the "Replace Data" action under Data Conversion.

🛠️ How to Set Up

  1. In the Flowbot edit screen, click the + button to add a new action.

  2. Go to Data ConversionReplace Data.

  3. In the setup, use the following:

    1. String to Replace: The continuous mobile phone number you want to format with hyphens.

    2. Search Part to Replace (specify regular expressions): (?<=^.{3})|(?<=^.{7})

    3. String after Replacement: - (This will add hyphens after the 3rd and 7th characters in the number.)


📚 Related Guides

Search Keywords

Regular expressions, phone number formatting, hyphen insertion, mobile phone numbers

Did this answer your question?