package main
import (
"regexp"
"fmt"
)
func main() {
var re = regexp.MustCompile(`(?m)\beps\b\D*?(\p{Sc}?\d*\.?\d+(?:\s*(?:to|\p{Pd})\s*\d*\.?\d+)?)`)
var str = `to $2.00 on an ongoing basis. the ongoing eps guidance excludes both a 68 cent-per-share charge associated with the establishment of the solutia-related reserve and a tax benefit of
wheat and barley business. on a reported basis, eps is in the range of $1.56 to $1.71 per share for the full fiscal year. (for a reconciliation of ongoing... eps was 4.56 to 4.98
the year ago quarter while 2004 full year eps was $.93, up 7.7% from 2003. return on equity was 21.7% for the fourth quarter and 20.4% for the full`
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/