Common Go Regular Expressions

playground

package main

import (
	"fmt"
	"regexp"
)

func main() {

	content := []byte(`
	# comment line
   2 option1= value1
	option2 = value2
    optione30 = 3423

	# another comment line
	option3= value3
`)

	re := regexp.MustCompile(`(?m)(?P<key>\w+)\s*=\s+(?P<value>\w*)$`)
	fmt.Printf("%q\n", re.FindAllSubmatch(content, -1))

}