I'm trying to remove all from a string.
runReportReq.responseText.replace(/\<style>.*?\</style>/, '')
Can anyone show me where I'm going wrong?
Try this:
runReportReq.responseText.replace(/<style>.*?<\/style>/g, '')
You can test the validity of the regex syntax here for JavaScript with sample code:
Regex Tester
You can test the regex itself with sample input here for JavaScript:
RegexPal
You've not escaped the right character, try with:
/<style>.*?<\/style>/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With