Categorygithub.com/daihasso/beagle
modulepackage
0.0.3
Repository: https://github.com/daihasso/beagle.git
Documentation: pkg.go.dev

# README

Beagle

A super simple regexp wrapper to make things more digestible for the average usecase.

Example Usage

package main

import (
    "fmt"

    "github.com/DaiHasso/beagle"
)

func main() {
    regex := beagle.MustRegex(`(?P<thing>\S+) (are|is) (?P<difficulty>\S+)`)

    result := regex.Match(
        "I heard that go regexps are hard! But maybe it is easy.",
    )

    if result.Matched() {
        fmt.Println("It worked!")
    }

    fmt.Printf(
        "Actually %s %s %s\n",
        result.NamedGroup("thing")[0],
        result.UnamedGroups()[0],
        result.NamedGroup("difficulty")[1],
    )
}

Will result in:

Actually regexps are easy.

# Functions

No description provided by the author
No description provided by the author
No description provided by the author

# Structs

No description provided by the author
No description provided by the author