Created
June 14, 2013 15:31
-
-
Save dviramontes/5782766 to your computer and use it in GitHub Desktop.
regex for warmup excersices, https://github.com/dviramontes/warmup-exercises
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
# emulates "nrmwyoldrmtob".scan(/.{1,5}/) | |
# encodes 5 char words and then some | |
class A | |
@replace = (str)-> | |
str.match(/[a-z|0-9]{5}|[\w]+/ig).join(" ") | |
test= A.replace("nrmwyoldrmtob") | |
console.log(test) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment