<? require "config.php"; dl("extensions/php_mssql70.dll"); if (!isset($page)) { $page=1; } if ($page<=0) { $page=1; } $db=mssql_connect($local,$user,$pass); mssql_select_db($name,$db); $query=mssql_query("select count(*) as date from news&quo...[ 查看全文 ]
代码如下: Function AutoLinkURLs(strString) Dim match, matches, offset, url, email, link, relnkAutoLinkURL relnkAutoLinkURL = "a href=""[[%URL%]]""[[%URLText%]]/a" If Not IsObject(regExp) Then Set regExp = New RegExp regExp.Global = True regExp.IgnoreCase = True 'Look for URLs regExp.Pattern = "(((ht|f)tps?://)|(www\.))([\w-]+\.)+[\w-:]+(/[\w- ./?%#;&=...[ 查看全文 ]
看下面这段代码: function test(s){ var reg = /./g; console.log(reg.exec(s)); console.log(reg.lastIndex); var reg = /./g; console.log(reg.exec(s)); console.log(reg.lastIndex); } test("abcd"); test("efgh"); 我以为输出的lastIndex的值应该都是1,但是实际上的输出如下: a 1 a 1 f 2 f 2 感觉就像是在第二次调用test的时候第2行和第6行并没有产生新的正则表达式,其之前的属性l...[ 查看全文 ]