Clever split
This commit is contained in:
5
clever-split/index.js
Normal file
5
clever-split/index.js
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
// https://www.codewars.com/kata/clever-split/train/javascript
|
||||||
|
|
||||||
|
function cleverSplit(s) {
|
||||||
|
return s.match(/(\[[^\]]+\])|([!\w]+)/g);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user