So I have this java String.
<script type="text/javascript"
src="https://c328740.ssl.cf1.rackcdn.com/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML">
</script>
<script type='text/x-mathjax-config'>
MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}});
</script>
that I want to replace with "".
What I am doing is this :
.replaceAll("(<img[^>]*>)|(<script[^>]*>)", "")
but this doesn’t remove MathJax.Hub.Config({tex2jax: {inlineMath: [['$','$'], ['\\(','\\)']]}}); between the script tags.
the above regex looks for all <img> tags also and replaces them with "", the same I want to achive for the above shown <script> tags and everything between them also.
This seems to be working
note that your str has CRLF this why DOTALL