Open mafar opened 5 years ago
new MultiRegExp2(string, flags)
like vanilla js new RegExp(string,flags);
var string = "/abc/ig"
I will propsoe function renaming as well since from https://regex101.com and possibility if mutipule matches ,
execForAllGroups(string: string, includeFullMatch: boolean)
renamed to execAll(string: string)
I dont see why , includeFullMatch: boolean
would be needed in this case
this way if global flag
was used then for more than one matches user can loop through matches
If there was no global flag
, user can just use array (0) which is first Match , or he can still loop through it but it will have one result anyway
execForGroup(string: string, group: Number)
can be renamed to
execForMatchGroup(string: string, match: Number, group: Number)
it will be very standard experience if user is given all flag choices instead of forcing it.
oh and return result would be
[ [match0] [match1] [match..n]]
instead of [match0]
which is case right now
regex101: https://regex101.com/r/Whivxv/1
JSFIDDLE: (with MultiRegExp2 usage for same test case) https://jsfiddle.net/bababalcksheep/o104bcq6/18/
should return
2 matches
, each macth has1 full match
and2 gruops