Categorygithub.com/di-wu/regen
modulepackage
1.0.0
Repository: https://github.com/di-wu/regen.git
Documentation: pkg.go.dev

# README

regen

GoDoc

regen is a go library that creates random strings based on regular expressions.

usage

  • limit is the maximum number of times *, + or repeat.
    values smaller than 0 default to 10.
package main

import (
	"fmt"

	"github.com/di-wu/regen"
)

func main() {
    g, err := regen.New(`[01]{5}`)
    if err != nil {
        panic(err)
    }
    for i := 0; i < 5; i++ {
        fmt.Println(g.Generate())
    }
}
00001
01000
11101
11000
10000

cli

  • regex (string): regex used to generate strings
  • seed (int64) : a certain seed to generate strings
  • limit (int) : the amount of iterations of *, + and repetitions
  • n (int) : number of regex strings to generate
go run cli/cli.go -regex="[01]{5}" -n=5

# Packages

No description provided by the author

# Functions

Creates a new generator with given string.

# Structs

No description provided by the author