Separate string in groups of 4 in JavaScript

This magic regex will separate a string into groups of 4 characters (or less if in the end the group is smaller)

Output: “1234-5678-910”

Leave a Reply

Add <code> Some Code </code> by using this tags.

*
*