Last active
December 10, 2015 06:08
-
-
Save evandavis/4392719 to your computer and use it in GitHub Desktop.
Regex Tuesday Challenge solutions
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
var re = /^(20(0[0-9]|1[0-2])|1[0-9]{3})\/(0[1-9]|1[0-2])\/(0[1-9]|[1-2][0-9]|30)\s([0-1][0-9]|2[0-3]):([0-5][0-9])(:[0-5][0-9])?$/; |
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
''.replace(/(?:^|([^*]))\*([^*].*?[^*]+)\*(?!\*)/ig, "$1<em>$2</em>"); |
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
var re = /^\d{1,3}((,|\s)\d{3})*(\.\d+)?$/; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment