<span>hello,world</span>
怎么用正則把所有<span></span>替換成<input type='text'><input type=hidden value='https://bbs.csdn.net/topics/hello,world'>
uj5u.com熱心網友回復:
str = "<span>hello,world</span><span>hello,world_2</span><span>hello,world_3</span>"
Set RegEx = New RegExp
RegEx.Global = True
RegEx.IgnoreCase = True
RegEx.Pattern = "<span>([^<]+?)<\/span>"'"[a-z](\d+)[a-z]{3}"
str = regex.Replace(str,"<input type=hidden value='https://bbs.csdn.net/topics/$1'>")
Set RegEx = Nothing
Response.Write str
uj5u.com熱心網友回復:
謝謝,現在有這些資料,AA,BB,CC
怎么將這些資料按", "分割后匹配到Input里面呢
str = regex.Replace(str,"<input type=hidden value='https://bbs.csdn.net/topics/AA'>")
str = regex.Replace(str,"<input type=hidden value='https://bbs.csdn.net/topics/BB'>")
像這樣的
uj5u.com熱心網友回復:
比如<span style='font-size:4px'>asfsfsdfs</span> 怎么去掉<span>和</span>呢,只留下asfsfsdfs文字uj5u.com熱心網友回復:
s = "<span style='font-size:4px'>asfsfsdfs</span>"
Dim RegEx, RegMatches
Set RegEx = New RegExp
RegEx.Pattern = "<span([^>]+?)>([^<]+?)<\/span>"
RegEx.Global = True
Set RegMatches = RegEx.Execute(s)
For Each RegMatch In RegMatches
Response.Write RegMatch.SubMatches(1)
Next
轉載請註明出處,本文鏈接:https://www.uj5u.com/qianduan/70093.html
標籤:ASP
上一篇:js Data未定義
下一篇:JavaScript
