# How to insert multiple ":" in a string

**URL:** https://discourse.nodered.org/t/how-to-insert-multiple-in-a-string/68867
**Category:** General
**Tags:** function-node
**Created:** [11 October 2022 13:51 UTC](https://discourse.nodered.org/t/how-to-insert-multiple-in-a-string/68867 "2022-10-11T13:51:39Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![igmam](https://avatars.discourse-cdn.com/v4/letter/i/3ec8ea/32.png) [@igmam](https://discourse.nodered.org/u/igmam)
#### Post date: [11 October 2022 13:51 UTC](https://discourse.nodered.org/t/how-to-insert-multiple-in-a-string/68867/1 "2022-10-11T13:51:39Z")

</div>

Hi there,

I'm getting a MAC Address without ":" character betweend the characters.

example:

001122334455

But want to get this version

00:11:22:33:44:55

How to do this in a efficient way?

Thank you!

---

<div class="post-metadata">

### Author: ![Steve-Mcl](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/steve-mcl/32/4826_2.png) [@Steve-Mcl](https://discourse.nodered.org/u/Steve-Mcl)
#### Post date: [11 October 2022 14:06 UTC](https://discourse.nodered.org/t/how-to-insert-multiple-in-a-string/68867/2 "2022-10-11T14:06:22Z")

</div>

```auto
"001122334455".match(/.{2}/g).join(':')

```

![image](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/9/7/97c373d0909f6f75516691b19fb22a88435367e9.png)

---

<div class="post-metadata">

### Author: ![igmam](https://avatars.discourse-cdn.com/v4/letter/i/3ec8ea/32.png) [@igmam](https://discourse.nodered.org/u/igmam)
#### Post date: [11 October 2022 15:38 UTC](https://discourse.nodered.org/t/how-to-insert-multiple-in-a-string/68867/3 "2022-10-11T15:38:39Z")

</div>

Wow, thanks for the fast and correct answer!

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)
#### Post date: [25 October 2022 15:38 UTC](https://discourse.nodered.org/t/how-to-insert-multiple-in-a-string/68867/4 "2022-10-25T15:38:43Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
