Reg test for baby replacement
by jessekinsman
JavaScript
var test = `/** childReplacement cssCAVariables **/
@media screen and (min-width: 48rem) {
body {
--hRow1: 68px;
--logoWidth: 172px;
--acctLinkColor: #066f6f;
--btnPri: #26a09c;
--boldHeaderFont: 500 14px Montserrat,Helvetica,Arial,sans-serif;
--acctHeaderText: 600 18px/1.44 Montserrat,Helvetica,Arial,sans-serif;
}
@media screen and (min-width: 48rem) and (max-width: 80rem) {
body {
--headHeight: 130px;
}
}
}
@media screen and (min-width: 64rem) {
body {
--hRow1: 74px;
}
}
@media screen and (min-width: 80rem) {
body {
--hRow1: 78px;
--csBannerWidth: 33.333%;
--headHeight: 130px;
--csModalLeft: 66.666666%;
}
}
/** end childReplacement cssCAVariables **/`
let match = ['','cssCAVariables'];
//let reg = new RegExp("\\/\\*\\*\\s?childReplacement\\s?" + match[1] + "\\s?\\*\\*/\n(.*?)+(?=/\\*\\*)");
//let reg = new RegExp("\\/\\*\\*\\s?childReplacement\\s?" + match[1] + "\\s?\\*\\*/(.|[\n])+(?=/\\*\\*)");
let reg = /\/\*\*\s?childReplacement\s([^\s]+)\s\*\*\/(.+|[\n|\r]+)(?=\/\*\*)/g;
console.log(reg.exec(test));