Skip to content

Instantly share code, notes, and snippets.

@miller3818
Created July 9, 2014 12:01
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 miller3818/388fc187c079d6be3d52 to your computer and use it in GitHub Desktop.
Save miller3818/388fc187c079d6be3d52 to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
</body>
</html>
// RegEx that will slice the word that is between the two )('s
var myString = "this is something blah blah blah Host: shitballs stuff blah blah";
//var myString = "something format_abc";
var myRegexp = /(?:^|\s)Host: (.*?)(?:\s|$)/;
var match = myRegexp.exec(myString);
alert(match[1]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment