Created
March 17, 2016 08:57
-
-
Save sporting/eb9b7625c272b383bc3b to your computer and use it in GitHub Desktop.
using Javascript regular expression to split
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
key="123 456 777777 32432 531 431431 531453 5315312 4312341 fdkljas asdkj 314 fdaslj 431lj" | |
var result = key.split(/(\w+\s\w+\s\w+\s\w+\s\w+\s)/gi) | |
for (var item in result){ | |
console.log(result[item]) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment