Browse Source

fix test of the grouping exercise

pull/654/head
MSilva95 4 years ago
parent
commit
36ae5dcbf5
  1. 7
      go/tests/prog/grouping_prog/main.go

7
go/tests/prog/grouping_prog/main.go

@ -45,17 +45,16 @@ func brackets(regexp, text string) {
runes = runes[1 : len(runes)-1]
result := simpleSearch(runes, text)
for i, s := range result {
if !unicode.Is(unicode.Hex_Digit, rune(s[len(s)-1])) {
s = s[:len(s)-1]
if !unicode.Is(unicode.Hex_Digit, rune(s[len(s)-1])) && !unicode.IsLetter(rune(s[len(s)-1])) {
s = s[0 : len(s)-1]
}
if !unicode.Is(unicode.Hex_Digit, rune(s[0])) {
s = s[1:]
s = s[0:]
}
fmt.Printf("%d: %s\n", i+1, s)
}
}
}
func main() {
// brackets("al|b", "ale atg bar sim nao pro par impar") In JS it's used without brackets
if len(os.Args) == 3 {

Loading…
Cancel
Save