I would like to check if my regex is true. So this is what I have tried:
const a = new RegExp(`(?<=TITLE.+prefix=)[^\]|\|]+`);
That returns true, which is correct:
console.log(a.test('[TITLE|prefix=bss|suffix=a] [STORENAME] [DYNAMIC|limit=10|seperator=-|random=1|reverse=1]'));
That one returns true but it shouldn't:
console.log(a.test('[ANYTHING|somethingelse=bss|suffix=a] [STORENAME] [DYNAMIC|limit=10|seperator=-|random=1|reverse=1]'));
See here the result:
const a = new RegExp(`(?<=TITLE.+prefix=)[^\]|\|]+`);
console.log(a.test('[TITLE|prefix=bss|suffix=a] [STORENAME] [DYNAMIC|limit=10|seperator=-|random=1|reverse=1]'));
console.log(a.test('[ANYTHING|somethingelse=bss|suffix=a] [STORENAME] [DYNAMIC|limit=10|seperator=-|random=1|reverse=1]'));