VFP正则表达式应用:数字替换

正则表达式 | 2017-11-19 19:19:49 | 72次阅读 | 0评
希望把
asdadas123asdasdas456asdasdasd789asdasd
替换为:
asdadas[123]asdasdas[456]asdasdasd[789]asdasd
在VFP中也可以做到,但过程比较复杂

CLEAR 
Re = Createobject("VBScript.RegExp")
Re.Global = .T.
Re.Ignorecase = .F.
RE.Pattern ="(\d{3})"
cStr="asdadas123asdasdas456asdasdasd789asdasd"
?cStr
?Re.Replace(cStr,"[$1]")













博友评论,共0条
浏览156269次