Clever split

This commit is contained in:
2017-08-19 15:49:12 +02:00
parent 44f52e4467
commit f69530e2e8

5
clever-split/index.js Normal file
View File

@@ -0,0 +1,5 @@
// https://www.codewars.com/kata/clever-split/train/javascript
function cleverSplit(s) {
return s.match(/(\[[^\]]+\])|([!\w]+)/g);
}