2

I’ve a CSS string like

    #xyz{
          color:#ee2ee2;
      }
     .abc{
        background-color:#FFFFFF;
        border-color:1px solid #eee;
     }
    .def #xyz{
       border-color:1px solid #ddd;
    }


I need to replace the #xyz (or any other ID selector) with .xyz without changing the color: #ee2ee2(or any other color selector).
Basic java-script code would do

I’ve tried some regex but it fails a few cases

cssText.replace(/#([a-zA-Z])/gm, '.$1');