Last active
November 1, 2018 13:23
-
-
Save lancevo/59b0ebda58f15cc3bff6890496bd9251 to your computer and use it in GitHub Desktop.
Some of the common regex patterns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Separate numbers to a group of 3 and add a comma | |
'123456'.replace(/(\d)(?=(\d{3})+(?!\d))/g, "$1,"); // output: 123,456 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment