Last active
April 17, 2017 14:20
-
-
Save pom421/05ff1e911ca3538a4dfce3a6f6e90f17 to your computer and use it in GitHub Desktop.
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
Référence : https://www.codewars.com/kata/please-help-bob/javascript | |
Exemples : | |
"Hello, I am Mr Bob" --> "Hello, I amerr Mrerr Boberr" | |
"THIS IS CRAZY!" --> "THISERR ISERR CRAZYERR!" | |
const errBob = string => | |
string | |
.replace(/([bcdfghjklmnpqrstvwxyz])(\W|$)/g, '$1err$2') | |
.replace(/([BCDFGHJKLMNPQRSTVWXYZ])(\W|$)/g, '$1ERR$2'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment