On Fri, Mar 10, 2017 at 4:52 PM, <fishyw...@gmail.com> wrote: > Playground link is at https://play.golang.org/p/6uXcuL3iyF > > I tried to match "asdf \t\nkkkk" against `\s*` and it doesn't match, but > `\s+` works. Am I holding it wrong?
\s* matches any number of whitespace characters, including zero. FindString and FindStringIndex return the leftmost match of the regexp in the string. Since the string does not start with a whitespace character, the leftmost match matches a sequence of zero whitespace characters at the start of the string. Ian -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.