Javascript – regex to find match if a colon character exists between double curly brackets {{key:value}}
I am trying to refactor the method below to use regex instead of indexOf: hasMatch(value: any): boolean { if (isDefined(value)) { const valueStr = JSON.stringify(value); return valueStr.indexOf('{{') > -1 && valueStr.indexOf(':') > -1; } else { return false; } }…