I’m receiving multiple strings from a API and sometimes I have a string that looks like this.
first part <!-- Slut på Mall: variable --> second part
I want to use jQuery to exclude the part before and the “Slut… variable –>“. Leaving me with the second part.
Just to be clear, the variable is dynamic and will change.
I have been playing around with replace, and match but so far I have failed. I have understood that regex is the way to go
regex = /Mall:.*\s+-->(.*)\z/
But I don’t know what function to use with that?
Will return
<!-- Slut på Mall: variable --> second part