diff --git a/src/claims.js b/src/claims.js index c47c2ab..6e76bd0 100644 --- a/src/claims.js +++ b/src/claims.js @@ -45,15 +45,12 @@ const runVerificationJson = ( switch (checkRelation) { default: case 'contains': - re = new RegExp( - checkClaim.replace('[', '\\[').replace(']', '\\]'), - 'gi' - ) - res.isVerified = re.test(proofData.replace(/\r?\n|\r/, '')) + re = new RegExp(checkClaim, 'gi') + res.isVerified = re.test(proofData.replace(/\r?\n|\r|\\/g, '')) break case 'equals': res.isVerified = - proofData.replace(/\r?\n|\r/, '').toLowerCase() == + proofData.replace(/\r?\n|\r|\\/g, '').toLowerCase() == checkClaim.toLowerCase() break case 'oneOf':