(?is)<table[^>]*>(?:(?!</table>).)*</table> --取字符中的table集合 (?is)<table[^>]*id="tb_readmore"[^>]*>(?:(?!</table>).)*</table> --去指定ID的Table集合 (?is)<tr>(?:\s*<td[^>]*>(.*?)</td>)*\s*</tr> --取tr集合 (?is)<tr[^>]*>(?:\s*<td[^>]*>(.*?)</td>)*\s*</tr> --取tr的集合并按td分组 (?is)<td[^>]*>(?:(?!</td>).)*</td> --取td的集合 <div.*[^>]>.*</div> --取div集合 (?i)<a.*href="(?<link>.*[^"])"\s.*[^>]>(?<name>.*)</a> --取得链接地址和名称 (?is)<a[^>]*?href=(['"])?(?<url>[^'"\s>]+)\1[^>]*>(?<text>(?:(?!</?a\b).)*)</a> --取得链接地址和名称 (?is)<a[^>]*?href=(['"])?(?<url>/m[^'"\s>]+)\1[^>]*>(?<text>(?:(?!</?a\b).)*)</a> --取得/m开头的链接的地址集合 (?is)<td[^>]*>(?<text>(?:(?!</?td\b).)*)</td>--取td的集合 (?is)<img[^>]*?src=(['"])?(?<url>[^'"\s>]+)\1[^>]*/>--取img的src (?is)<img[^>]*?src=(['"])?(?<url>[^'"\s>]+)[^>]*title=(['"])(?<title>[^'"\s>]+)[^>]*/> --取得img的src和title <div.*[^>]>[^<>]*(((?'DIV'<div[^>]*>)[^<>]*)+((?'-DIV'</div>)[^<>]*)+)*(?(DIV)(?!))</div>--取嵌套div的组合
function getUrlParam(name) { var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)"); var r = window.location.search.substr(1).match(reg); if (r != null) return unescape(r[2]); return null; };
String.prototype.trimEnd = function (chars) { if (chars == null) { chars = FRL.strings.whiteSpaceChars; } if (this == null || this == "") { return ""; } var i; var l = this.length; for (i = this.length - 1; (i >= 0) && (chars.indexOf(this.charAt(i)) > -1); i--) { } return this.substring(0,i + 1); }; String.prototype.trimStart = function (chars) { if (chars == null) { chars = FRL.strings.whiteSpaceChars; } if (this == null || this == "") { return ""; } var i; var l= this.length; for (i = 0; (i < l) && (chars.indexOf(this.charAt(i)) > -1); i++) { } return this.substring(i); }; String.prototype.trim = function (chars) { if (chars == null) { chars = FRL.strings.whiteSpaceChars; } var source = this; if (source == null || source == "") { return ""; } var i; var l; l = source.length; for (i = 0; (i < l) && (chars.indexOf(source.charAt(i)) > - 1); i++) { } source = source.substring(i); l = source.length; for (i = source.length - 1; (i >= 0) && (chars.indexOf(source.charAt(i)) > - 1); i--) { } source = source.substring(0,i + 1); return source; };