common

package
v0.0.0-...-5007e99 Latest Latest
Warning

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

Go to latest
Published: Jan 8, 2020 License: MIT Imports: 1 Imported by: 3

Documentation

Overview

Package common supplies a few very commonly used patterns found in CLI/Web apps namely case insensitive matching for yes/no questions and matching html tags, ascii characters and ansi escaped characters

Index

Constants

This section is empty.

Variables

View Source
var (
	// Matchers yes/no strings
	YN  = regexp.MustCompile(`(?i)^(y(es|)|n(o|))$`)
	Yes = regexp.MustCompile(`(?i)^y(es|)$`)
	No  = regexp.MustCompile(`(?i)^n(o|)$`)
	// Matcher for HTML tags
	HTMLTag = regexp.MustCompile(`(<[^>]*>)`)
	// Matcher for ASCII chars
	ASCII = regexp.MustCompile(`[\x00-\x7F]`)
	// Matcher for ANSI escape chars (colors etc)
	ANSI = regexp.MustCompile(`\x1b[^m]*m`)
)

Exported vars

Functions

This section is empty.

Types

This section is empty.

Jump to

Keyboard shortcuts

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