Open mafar opened 5 years ago
for UMD
npm install --save-dev babel-plugin-transform-es2015-modules-umd
then create
.babelrc
file with content
{
"plugins": ["transform-es2015-modules-umd"]
}
and then run npm build
nw you will have universal module for any env , distribution
Here is fiddle https://jsfiddle.net/bababalcksheep/o4qn7jwe/48/ with UMD
and this lib does not work correctly for nested groups. https://jsfiddle.net/bababalcksheep/o4qn7jwe/48/ from this, try query and str and comapre match with regex101.com
I added a build for iife for browsers (https://raw.githubusercontent.com/valoricDe/MultiRegExp2/master/dist/multiRegExp2.js). In the jsfiddle I do not see nested regexps. Could you write the regexp here and the expected output?
https://regex101.com/r/V16o77/1
see this
string aaaaaaaaaaaaaa
regex /a(a*)a/g
In ur case , full matach which is first result is ok , But 2nd group is not , not the match , not the start end as well
in any case, consider using UMD over iife , requireJs is still around
I added UMD
regarding the matches. I added a testcase for your issue and it correctly returns a matching group with start 1 and end 13. Could you clone the project and run npm test?
new MultiRegExp2(/a(a*)a/).execForAllGroups("aaaaaaaaaaaaaa", false)
TestCase 7 passed: => [{"match":"aaaaaaaaaaaa","start":1,"end":13}]
Give me sometime and i will make a jsfiddle with all of my test cases . thankx
Moving on here https://github.com/valoricDe/MultiRegExp2/issues/10 CLOSE this issue and consider using jsdeliver or any other CDN for this repo. multiRegExp2.js umd and iife should be deliverable , for web moslty
and with UMD present , there is no need of iife
no dist folder at https://www.jsdelivr.com/package/npm/multi-regexp2
It will be very helpful if there is a CDN link so that lib can be tested .
https://github.com/valoricDe/MultiRegExp2/blob/master/dist/multiRegExp2.js file is also wrong for web distribution as ther is no UMD wrapper
Just paste code in any jsfiddle and run to see compatibility