JSFiddle - React, Tailwind, and code Playground

by Gautam Kumar

JavaScript

a = 'text-shadow : val1; -moz-text-shadow : val1; -webkit-text-shadow : val1;';
prop = 'text-shadow'
re =  new RegExp(prop + '[^;]+?\\;','g');


console.log(a.replace( re, 'text-sahdow : val3' ));

/*
 now i can give any prop it wil repalce all occurrences
 no need to type specifically for every prefix

*/