I am trying to search text for a given string using match. However what I am searching for is not a constant value.
console.log((data.match(/VARIABLE/g) || []).length)
I have tried this:
console.log((data.match(/${VARIABLE}/g) || []).length)
But still coming back as no match as "${VARIABLE}" is not in the text i am searching.
thanks in advance :)