JSFiddle - React, Tailwind, and code Playground

by Mohammed Ismail Ansari

JavaScript

var stringer = "<xml version='1.0' encoding='utf-8'><html xmlns:sr='urn:schemas-gehealthcare:isip:dicom:structuredreport' xmlns:msxsl='urn:schemas-microsoft-com:xslt'>  <head>    <title>Structured report of WILKINS, CHARLES</title>    <style type="text/css"> span {nicepreiprenice</style>";

var replacePre = function (str) {
            return str.replace(/<style[^>]*>.*<\/style>/g,
                function(input) {
                    return input.replace(/(pre)/g, "pre-wrap");
                });
        };

console.log(replacePre(stringer));