Skip to content

Instantly share code, notes, and snippets.

@vanchelo
Created May 5, 2015 19:42
Show Gist options
  • Save vanchelo/c1f9eae7c46171344d99 to your computer and use it in GitHub Desktop.
Save vanchelo/c1f9eae7c46171344d99 to your computer and use it in GitHub Desktop.
JS Bin // source http://jsbin.com/fixuja
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">
var r = /(\{\{user.(.*?)\}\})/gi
var result, res = [];
var text = '{{user.name|Petr}} hello {{user.email}}';
while (result = r.exec(text)) {
res.push(result[1])
}
console.log(res)
</script>
<script id="jsbin-source-javascript" type="text/javascript">var r = /(\{\{user.(.*?)\}\})/gi
var result, res = [];
var text = '{{user.name|Petr}} hello {{user.email}}';
while (result = r.exec(text)) {
res.push(result[1])
}
console.log(res)</script></body>
</html>
var r = /(\{\{user.(.*?)\}\})/gi
var result, res = [];
var text = '{{user.name|Petr}} hello {{user.email}}';
while (result = r.exec(text)) {
res.push(result[1])
}
console.log(res)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment