sekwence

package module
v0.0.0-...-24bab1c Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2019 License: MIT Imports: 4 Imported by: 2

README

Go sekwence library

Sekwence is a library for parsing bash-like patterns {00..12}, {1,3,5,7} and generate corresponding string sequences.

Example
sekwence.ExpandPattern("host{00..03}{a,c,f}.example.com")
> host00a.example.com
> host00c.example.com
> host00f.example.com
> host01a.example.com
> host01c.example.com
> host01f.example.com
> host02a.example.com
> host02c.example.com
> host02f.example.com
> host03a.example.com
> host03c.example.com
> host03f.example.com

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ExpandPattern

func ExpandPattern(pattern string) ([]string, error)

ExpandPattern expands the whole pattern recursively and returns all the resulting matches

func StringRange

func StringRange(from string, to string, exclude bool) ([]string, error)

StringRange implements ruby-like string range generators i.e. ruby's ("a0".."e4").to_a equals to StringRange("a0", "e4", false) exclude params indicates that value of "to" should be excluded

func Succ

func Succ(s string) (string, error)

Succ implements ruby-like String.succ

Types

This section is empty.

Jump to

Keyboard shortcuts

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