Skip to content

Instantly share code, notes, and snippets.



Created Apr 16, 2018
What would you like to do?
//usr/bin/env go run $0 $@ ; exit
package main
import (
func match(re string, line string) []string {
return regexp.MustCompile(re).FindStringSubmatch(line)
func main() {
stdin := bufio.NewScanner(os.Stdin)
for linenumber := 1; stdin.Scan(); linenumber++ {
line := stdin.Text()
if m := match(`^(.*?)(をを)(.*?)$`, line); m != nil {
fmt.Printf("%d: %s【%s】%s\n", linenumber, m[1], m[2], m[3])

This comment has been minimized.

Copy link
Owner Author

@hyuki hyuki commented Apr 16, 2018

$ cat file.txt
$ go run lint1.go < file.txt
2: これ【をを】どうしようか。
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.