正则表达式每行仅打印第一个字符串

I'm trying to get more experience with Go by writing a program that takes input from a .txt file, then sorts each string alphabetically and prints each one out with it's corresponding line number. Right now I'm having a problem where my program is only printing out the first string per line when I pass it my input.txt file

package main

import "fmt"
import "regexp"
import "bufio"
import "log"
import "os"
import "strings"

func main() {

    var i int = 0 //counter for loop

    var words1 string

    scanner := bufio.NewScanner(os.Stdin)

    //holdWords := make(map[string]int)
    //Loop through the txt doc and cleanup the lines of strings
    for scanner.Scan(){
        i=i+1

        words1=scanner.Text(); //get the text from line
        words1=strings.TrimSpace(words1) //trim the trailing and leading whitespace

        reg, err:=  regexp.Compile("^[a-zA-Z]+") //regex to look for letters/spaces

        if err != nil{
            log.Fatal(err)
        }

        fmt.Println(reg.FindString(words1))//just testing to see if it prints correct values

    }
}

As Simon mentioned, you should be using FindAllString to find all matches. Also, you need to remove the ^ from the beginning of the RE (^ anchors the pattern to the beginning of the string). You should also move the regexp.Compile outside the loop for efficiency.

https://play.golang.org/p/Q_yfub0k80

As mentioned here, FindAllString returns a slice of all successive matches of the regular expression. But, FindString returns the leftmost match.