diff options
author | KatolaZ <katolaz@freaknet.org> | 2017-07-15 01:26:39 +0100 |
---|---|---|
committer | KatolaZ <katolaz@freaknet.org> | 2017-07-15 01:26:39 +0100 |
commit | 726b399e4747032a3d052339cd62c57ae5b6767c (patch) | |
tree | aac8350e83bb13e9628dd287ca3aae97ecafcb32 /sandpit/test_regexp.go | |
parent | ed637037b75cb5dfe1b49e776956fa6ab3632b68 (diff) |
pipeline from spool to worker is done -- added examples
Diffstat (limited to 'sandpit/test_regexp.go')
-rw-r--r-- | sandpit/test_regexp.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/sandpit/test_regexp.go b/sandpit/test_regexp.go new file mode 100644 index 0000000..5ae1d88 --- /dev/null +++ b/sandpit/test_regexp.go @@ -0,0 +1,26 @@ +package main + +import( + "regexp" + "log" +) + + +func main (){ + + pattern := ".*" + str := "my_string" + + matched, err := regexp.MatchString(pattern, str) + + if err != nil { + log.Fatal("Error matching string: ", err) + } + + if matched { + log.Printf("Yes! '%s' matched '%s'\n", str, pattern) + } else { + log.Printf("Bad luck!\n") + } + +} |