HOME/Articles/

Golang golang-regex3 (snippet)

Article Outline

Go programming example 'golang-regex3'

golang-regex3

Golang beginners example: golang-regex3

package main

import (
    "fmt"
    "simonwaldherr.de/go/golibs/regex"
)

func main() {
    fmt.Println(regex.ReplaceAllString("FooBaR LoReM IpSuM", "\\W", ""))
    fmt.Println(regex.ReplaceAllString("FooBaR LoReM IpSuM", "[a-z]", ""))
    fmt.Println(regex.ReplaceAllString("FooBaR LoReM IpSuM", "[A-Z]", ""))
}