Last active
August 29, 2015 14:23
-
-
Save Pushplaybang/145fd12ff868cfc9cd78 to your computer and use it in GitHub Desktop.
My JS regex ref
This file contains hidden or 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
// HashTags | |
var simpleHash = /#\w+/g; | |
var complexHash = /\B#\w*[a-zA-Z]+\w*/g; // this seems uneccessary | |
// eg : | |
var input = "this is a #string with #tags to be #extracted"; | |
var matches = input.match(sinpleHash); | |
var matches = input.match(complexHash); | |
function validateEmail(email) { | |
var re = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i; | |
return re.test(email); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment