patterns

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2020 License: GPL-3.0 Imports: 2 Imported by: 0

README

* Patterns
I hate regex. I can never understand what it all does after writing it, and have to re-write it every time something changes. And most of the time I can't even get it to work. A lot of the time I just end up picking out a section of a string based on some start and end patterns.

This package is an attempt to make a nice golang library to make that a little bit easier. Probably adding more as I see the need.

Documentation

Overview

Package patterns contains various methods for pattern matching

Index

Constants

This section is empty.

Variables

View Source
var ErrInvalidMatch = errors.New("match is invalid")

ErrInvalidMatch error for when the supplied start or end strings isn't in the input string.

Functions

func Find

func Find(input string, start string, end string) (string, error)

Find Returns a substring matching the supplied arguments or error; doesn't contains the matched characters.

func FindAndSplit added in v0.0.5

func FindAndSplit(input, start, end, split string) ([]string, error)

FindAndSplit Returns a splitted substring based on params.

func FindRaw

func FindRaw(input string, start string, end string) (string, error)

FindRaw Returns a substring matching the supplied arguments or error; also contains the matched characters.

Types

This section is empty.

Jump to

Keyboard shortcuts

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