【发布时间】:2012-09-23 07:00:49
【问题描述】:
我在 Nodejs 中以字符串形式加载了一个简短的 html 文件。
<html>
<head>
<title>NodeJS</title>
<link href="/style/application.css" rel="stylesheet" type="text/css">
<script type="text/javascript" src="/scripts/script.js"></script>
<link rel="shortcut icon" href="/favicon.ico">
</head>
<body>
<center>
<h1><a href="#"><% title %></a></h1><br>
</center>
</body>
</html>
我需要获取<% 和%> 之间的每个字符串的数组。在这种情况下,只有标题。
尝试了一些 javascript 字符串函数和正则表达式,但找不到任何东西...
也许找到<% %> 的所有位置并以编程方式分割字符串?
【问题讨论】:
标签: javascript node.js