
lua string.match 表达式解释 #{0=([%a.%d]+)
functionextractAndAdd(document,param,name,response)localtmp=""tmp=string.match(respon...
functionextractAndAdd(document,param,name,response)
local tmp=""
tmp=string.match(response,param.."#{0=([%a.%d]+)")
if tmp~=null
then ...
哪位大侠能解释下,这个match的字符到底是啥? 展开
local tmp=""
tmp=string.match(response,param.."#{0=([%a.%d]+)")
if tmp~=null
then ...
哪位大侠能解释下,这个match的字符到底是啥? 展开
1个回答
展开全部
string.match是string库中的一个标准函数
local str = "today is 2013-11-4"
print(string.match(str,"%d%d%d%d")
就可以匹配出含有4个数字的地方 也就是匹配出2013所在的位置
%s表示空白符 包括空格 制表符 回车
%w %c 还有[]^. - + * ? 等魔法字符 具体参考使用说明
local str = "today is 2013-11-4"
print(string.match(str,"%d%d%d%d")
就可以匹配出含有4个数字的地方 也就是匹配出2013所在的位置
%s表示空白符 包括空格 制表符 回车
%w %c 还有[]^. - + * ? 等魔法字符 具体参考使用说明
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询