# Formatt phone number

**URL:** <https://community.glideapps.com/t/formatt-phone-number/63282>\
**Category:** Ask for Help\
**Created:** [June 29, 2023, 12:15am UTC](https://community.glideapps.com/t/formatt-phone-number/63282 "2023-06-29T00:15:12Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Eric\_Penn](https://sea2.discourse-cdn.com/flex002/user_avatar/community.glideapps.com/eric_penn/32/73888_2.png) [@Eric\_Penn](https://community.glideapps.com/u/Eric_Penn)\
**Post date:** [June 29, 2023, 12:23am UTC](https://community.glideapps.com/t/formatt-phone-number/63282/2 "2023-06-29T00:23:53Z")

</div>

Here’s a gem 💎 from Darren

> [@I need help with regular expressions and formatting](https://community.glideapps.com/t/i-need-help-with-regular-expressions-and-formatting/62863/3):
>
> I started having a look at this yesterday, and ended up going down a bit of a rabbit hole, so I put it aside. Had another look just now and it occurred to me that all you really need to do is strip out all the non-digits and then return the last 9 characters of whatever is remaining. So with that in mind, here is a bit of rough and ready JavaScript that does that. I’m sure it could be improved. const parts = p1.split(''); let digits = []; while (parts.length \> 0) { let bit = parts.shift(); …

---

_[View the full topic](https://community.glideapps.com/t/formatt-phone-number/63282)._
