package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`\$(.*):(.*)\;`)
var str = `$font-heading : var(--font-heading);
$font-standard : var(--font-standard);
$body-font-size : var(--body-font-size);
$size-h1 : var(--size-h1);
$size-h2 : var(--size-h2);
$size-h3 : var(--size-h3);
$size-h4 : var(--size-h4);
$size-h5 : var(--size-h5);
$size-h6 : var(--size-h6);
$top-font-size: var(--top-font-size);
$product-font-size: var(--product-font-size);
$product-price-size: var(--product-price-size);
$product-detail-size: var(--product-detail-size);
$product-detail-title-size: var(--product-detail-title-size);
$footer-size: var(--footer-size);
/* $font-icon: 20px;
$font-small-icon: 21px;
$font-small: 14px;
$font-medium: 17px;
$font-bold: 300;
*/`
var substitution = "$1"
fmt.Println(re.ReplaceAllString(str, substitution))
}
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for Golang, please visit: https://golang.org/pkg/regexp/