sputter

package module
v0.0.0-...-d9f7b4c Latest Latest
Warning

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

Go to latest
Published: Aug 4, 2017 License: MIT Imports: 8 Imported by: 0

README

sputter

POSIX basic regular expressions to psuedo random string generator, just for fun :)

Usage
package main

import (
	"fmt"

	"github.com/brianasapp/sputter"
)

func main() {
	s, err := sputter.Gen("[A-Z0-9]^(Word){1,3}$.+")
	if err != nil {
		panic(err)
	}
	fmt.Printf("generated below: \n%s\n", s)
}
$ go run main.go
generated below:
5
WordWord
Њѯѹկ¢↔≡♲

For cryptographically insecure usage, use the GenInsecure function in place of Gen

Supported Operations
  • literal
  • character class
  • capture
  • any char not newline
  • begin line
  • end line
  • star
  • plus
  • question
  • repeat
  • concat
  • alternation

note: for randomized repetition, there is a max value of 100. let me know if there's a better way to do it

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Gen

func Gen(exp string) (string, error)

Gen takes a regular expression and attempts

to generate a pseudo-randomized string that
matches the input expression.

func GenInsecure

func GenInsecure(exp string) (string, error)

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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