Literals in Regular Expression

Literals are the simplest form of pattern matching in regular expressions. They will simply succeed whenever that literal is found. func Match ¶ func Match(pattern string, b []byte) (matched bool, err error) Match reports whether the byte slice b contains any match of the regular expression pattern. Example Code Go Playground https://play.golang.org/p/ts3SyaxKQgF Resources go Read more…

Regular Expression

regrex package https://golang.org/pkg/regexp/ On-line Regular Expression https://regex101.com/ Meta Characters Metacharacters are characters that are interpreted in a special way by a RegEx engine. Here’s a list of metacharacters: [] . ^ $ * + ? {} () \ | [] – Square brackets Square brackets specifies a set of characters you wish to match. . – Period A period matches any single character Read more…