QUOTE:
VBScript 函数 之 从 HTML 源码中提取文本
作用: 显示文章摘要时使用该函数, 可避免提取到不完整的 HTML 标签
shawl.qiu
2006-7-2
作用: 显示文章摘要时使用该函数, 可避免提取到不完整的 HTML 标签
shawl.qiu
2006-7-2
- linenum
- '显示纯文本内容(只提取 HTML 中的文本, 不提取标签)
- function fPlainText(content)
- if isNull(content) then exit function
- set re1 = New regExp
- re1.Global = true
- re1.IgnoreCase = true
- re1.Pattern = "<.*?>"
- content = re1.Replace(content,"")
- if len(content)>200 then content=left(content,200)+"......"
- re1.Pattern = "/r/n/s*"
- content = re1.Replace(content,"<br/>")
- set re1=nothing
- fPlainText=content
- end function