crun

package module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 31, 2018 License: MIT Imports: 5 Imported by: 5

README

Generate all possibilities based on regexp

Build Status Go Report Card GoDoc GitHub license cover.run

Example

# Generates a number of all possible combinations of 1 to 6 digits in length
crun "\d{1,6}"

# Violence aesthetics
crun "(root|admin):[0-9]{4,5}"

# Note: If the number is too large, super slow

Download & Install

go get -u -v github.com/wzshiming/crun/cmd/crun

License

Pouch is licensed under the MIT License. See LICENSE for the full license text.

Documentation

Index

Constants

View Source
const MoreTimes = 18

MoreTimes Maximum omitted default value

Variables

This section is empty.

Functions

This section is empty.

Types

type Op

type Op uint8

An Op is a single regular expression operator.

const (
	OpLiteral Op
	OpRepeat
	OpAlternate
)

Operators are listed in precedence order, tightest binding to weakest.

func (Op) String

func (i Op) String() string

type Regexp

type Regexp struct {
	Op       Op
	Sub      []Regexps
	Rune     []rune
	Min, Max int
}

type Regexps

type Regexps []*Regexp

func NewSyntax

func NewSyntax(s string) Regexps

func NewSyntaxByRegexp

func NewSyntaxByRegexp(reg *syntax.Regexp) (out Regexps)

func (Regexps) Rand

func (r Regexps) Rand() String

Rand possibilities

func (Regexps) Range

func (r Regexps) Range(f func(String) bool) bool

Range all possibilities

func (Regexps) Size

func (r Regexps) Size() int

Size The number of possibilities that can match regularity

type String

type String []rune

String Encapsulated runes.

func (String) String

func (s String) String() string

Directories

Path Synopsis
cmd
crun command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL