问个正则
<%dim strstr = "Cache-Control: no-store, no-cache, must-revalidate,post-check=0, pre-check=0,privatePragma: no-cacheContent-Length: 32609Content-Type: text/htmlExpires: Sat, 18 Jan 1997 18:36:16 GMTSet-Cookie: bhCookieSaveSess=1; path=/Set-Cookie: bhCookieSess=1; path=/X-XSS-Protection: 0Date: Sun, 15 Apr 2012 12:54:21 GMTSet-Cookie: TSac8f66=cf69bf0e0f7faebafba0edada47b6bd4b0e5d8818c9eed6f4f8ac4fd; Path=/"' str 是一个http响应头,内含有很多回车%>
<script language="JavaScript">var str = 'Cache-Control: no-store, no-cache, must-revalidate,post-check=0, pre-check=0,private\r\nPragma: no-cache\r\nContent-Length: 32609\r\nContent-Type: text/html\r\nExpires: Sat, 18 Jan \r\n997 18:36:16 GMT\r\nSet-Cookie: bhCookieSaveSess=1; path=/\r\nSet-Cookie: bhCookieSess=1; path=/\r\nX-XSS-Protection: 0\r\nDate: Sun, 15 Apr 2012 12:54:21 GMT\r\nSet-Cookie: TSac8f66=cf69bf0e0f7faebafba0edada47b6bd4b0e5d8818c9eed6f4f8ac4fd; Path=/';var reg = /Set-Cookie:\s?(.+?)path=\//gi;var r = '';str.replace(reg, function($){ reg.exec(str); r += RegExp.$1;})r += 'Path=/';alert(r);</script>
[解决办法]
Set-Cookie:.+/s/Spath=
[解决办法]