|
|
@ -142,7 +142,7 @@ func pruneIndices(indices []Match) []Match {
|
|
|
|
// the regex, in the given string. The return value will be an empty string in two situations:
|
|
|
|
// the regex, in the given string. The return value will be an empty string in two situations:
|
|
|
|
// 1. No match was found
|
|
|
|
// 1. No match was found
|
|
|
|
// 2. The match was an empty string
|
|
|
|
// 2. The match was an empty string
|
|
|
|
func FindString(regex Reg, str string) string {
|
|
|
|
func (regex Reg) FindString(str string) string {
|
|
|
|
match, err := FindNthMatch(regex, str, 1)
|
|
|
|
match, err := FindNthMatch(regex, str, 1)
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return ""
|
|
|
|
return ""
|
|
|
|