On Mon, May 22, 2017 at 4:30 PM, Max Leske
<maxleske@gmail.com> wrote:
Hi guys,
I have this Javascript regex to prefix CSS rules to a given ID:
css = css.replace(/([,|\}][\s$]*)([\.#]?-?[_a-zA-Z]+[_a-zA-Z0-9-]*)/g, "$1" + "#myDiv" + " $2���);
/([,|}][\s$]*)([.#]?-?[_a-zA-
Z]+[_a-zA-Z0-9\-]*)
Thanks Max,
That allows me to create the regex correctly (well at least it doesn't fail). But how can I now make the translate, for example, from this input:
' .aClass { color: red ; } '
to
'#myDiv .aClass { color: red; }'