radiantmediaplayer / rmp-vast

A client-side JavaScript solution to load, parse and display VAST 2, 3 & 4 resources with HTML5 video
https://www.radiantmediaplayer.com/rmp-vast/app/
Other
95 stars 37 forks source link

Fixed macros patterns #36

Closed for1997 closed 3 years ago

radiantmediaplayer commented 3 years ago

Thanks but parentheses are actually not needed here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#using_parentheses

Parentheses around any part of the regular expression pattern causes that part of the matched substring to be remembered. Once remembered, the substring can be recalled for other use. See Groups and ranges for more details.

for1997 commented 3 years ago

Thanks but parentheses are actually not needed here: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#using_parentheses

Parentheses around any part of the regular expression pattern causes that part of the matched substring to be remembered. Once remembered, the substring can be recalled for other use. See Groups and ranges for more details.

No, you wrong. Parentheses is needed here. But you can use (?:x) syntax and not remember matched substring. Currently you replace this macros: "[ADCOUNT", "TRANSACTIONID", ..., "LATLONG]", but must "[ADCOUNT]", "[TRANSACTIONID]", ..., "[LATLONG]"

radiantmediaplayer commented 3 years ago

Allright my bad. Sorry for the confusion and thanks for insisting. I have added the parentheses in 3.0.5 release.