Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "regexp"
- )
- func main() {
- text := "Превед медвед"
- her := "хер"
- vowels := "аоэиуыеёюя"
- modified := "a"
- words := regexp.MustCompile("[ ]{1}").Split(text, -1)
- for _, word := range words {
- re := regexp.MustCompile(`[^` + vowels + `]*[` + vowels + `].(.+)`)
- modified := modified + re.ReplaceAllString(word, her + "${1}")
- fmt.Println(modified)
- }
- fmt.Println(modified)
- }
- ~
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement