Last active
July 28, 2016 11:11
-
-
Save AlexKotel/2a98a9f180312300334d to your computer and use it in GitHub Desktop.
Разделение разрядов числа пробелами
This file contains 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
// Разделение разрядов числа пробелами. | |
var str = 'Lorem ipsum 234456234 Lorem ipsum 7345287346 asdfae'; | |
str.replace(/(\d)(?=(\d\d\d)+([^\d]|$))/g, '$1 '); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment