我在 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字符串函数和正则表达式,但找不到任何东西......
也许找到所有位置<%
%>
并以编程方式切割字符串?