Skip to content

Instantly share code, notes, and snippets.

@sporting
Created March 17, 2016 08:57
Show Gist options
  • Save sporting/eb9b7625c272b383bc3b to your computer and use it in GitHub Desktop.
Save sporting/eb9b7625c272b383bc3b to your computer and use it in GitHub Desktop.
using Javascript regular expression to split
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