I have some strings in the following possible forms:
MYSTRING=${MYSTRING}
MYSTRING=
MYSTRING=randomstringwithvariablelength
I want to be able to regex this into MYSTRING=foo
, basically replacing everything between MYSTRING=
and
. I've tried:
re := regexp.MustCompile("MYSTRING=*
")
s = re.ReplaceAllString(s, "foo")
But it doesn't work. Any help is appreciated.
P.S. the
is to indicate that there's a newline for this purpose. It's not actually there.