Skip to content

Instantly share code, notes, and snippets.

@emohamed
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save emohamed/e2de7301640fc602aba2 to your computer and use it in GitHub Desktop.
Save emohamed/e2de7301640fc602aba2 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Regular Expression in Javascript</title>
<script>
var text = "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod " +
"tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, " +
"quis nostrud exercitation ullamco 159 975 9951 nisi ut aliquip ex ea commodo " +
"consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse " +
"cillum dolore eu fugiat ulla pariatur. Excepteur sint occaecat cupidatat non" +
"proident, sunt in culpa qui officia deserunt mollit anim id est laborum.";
var match = text.match(/\d{3} \d{3} \d{4}/);
console.log(match[0]);
</script>
</head>
<body>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment