WPS Excel启用正则表达式
新建一个空白表格文件
进入VB编辑器
插入模块
工具-引用-勾选正则表达式
(Microsoft VBScript Regular Express 5.5
)
复制代码
Function regexMatch(souceString,matchExpress,index)
Dim Reg As New RegExp
Reg.Global = True
Reg.Pattern = matchExpress
Reg.IgnoreCase = True
Set result = Reg.Execute(souceString)
regexMatch = result(index-1)
End Function
保存为启用宏的模板文件
必须使用Excel软件保存为xlam
加载宏的文件格式才可在下一步进行加载
加载宏
在开发工具菜单栏下选择加载项并选中保存的xlam文件即可加载
关于Excel办公,推荐方方格子插件
http://www.ffcell.com/home/products.aspx