Javascript获取<;中的Javascript(更多)注释;头>;

Javascript获取<;中的Javascript(更多)注释;头>;,javascript,Javascript,我最初收到此线程中的帮助: 我想使用Greasemonkey/Javascript从标记中获取注释 <html> <head> <!-- 12036,2011-11-29/11:02 --> <title>Products & Services</title> 将id=…行替换为: id = commentNode.data.match(/,(.*?)\s/)[1]; 转到regular-expres

我最初收到此线程中的帮助:

我想使用Greasemonkey/Javascript从标记中获取注释

<html>
    <head>
    <!-- 12036,2011-11-29/11:02 -->
    <title>Products & Services</title>

id=…
行替换为:

id = commentNode.data.match(/,(.*?)\s/)[1];

转到regular-expressions.info了解正则表达式。

只需更改正则表达式,即可匹配逗号和空格之间的所有内容。这不是很明显吗?当然,那正则表达式是什么?我不明白发生了什么。我不是程序员,也从未声称自己是程序员。我需要这个正则表达式的基本编程帮助。如果你不是程序员,为什么要编程?@Barmar:说来话长。谢谢你的帮助。
id = commentNode.data.match(/,(.*?)\s/)[1];