欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

<meta>正则

程序员文章站 2022-07-02 19:41:00
复制代码 代码如下:var charresult = this.getattribute("responsetext").match(/<...
复制代码 代码如下:

var charresult = this.getattribute("responsetext").match(/<meta.*?\wcharset\s*=\s*(\s+?)["'>\s]/i);
charresult = charresult ? charresult[1] : "gb2312";