Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package main
- import (
- "fmt"
- "regexp"
- )
- func main() {
- s := `"Abraham Lincoln" @en`
- reg := regexp.MustCompile(`"([^"]*)" *@en`)
- res := reg.ReplaceAllString(s, "${1}")
- fmt.Println(res) // Abraham Lincoln
- }
- reg := regexp.MustCompile(`"([^"]*)".*@en`)
Add Comment
Please, Sign In to add comment