I have a regular expression in node.js which matches some strange things. Look at this:
var regex = new RegExp('(<\?%)|(%\?>)', 'g');
console.log('<tag><?%text%?></tag>'.match(regex));
Leads to [ '>', '%', '%', '>', '>' ] and I don't understand why.
The purpose was to match <?% or %?> and it works perfectly fine on https://regex101.com/.