Module:String2/sandbox: Difference between revisions

Content deleted Content added
Add matchAll function
fix issue with named parameters
Line 283:
 
Usage:
{{#invoke:String2|matchAll|source=123 abc|456|abc}} returns '2'.
 
Parameters:
Line 291:
]]
function p.matchAny(frame)
local new_argssource_str = p._getParameters(frame.args, {['source',] or error('plainThe source parameter is mandatory.'})
local l_plain = p._getBoolean( new_argsframe.args['plain'] or true )
local source_str = new_args['source'] or error('The source parameter is mandatory.')
local l_plain = p._getBoolean( new_args['plain'] or true )
for i = 1, math.huge do
local pattern = frame.args[i]