Documentation
¶
Overview ¶
Package extractstatic extracts static parts of regexpes.
Useful to prefilter complicated regexp matches on large data sets.
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegexpLongest ¶
RegexpLongest extracts the longest static string from the given regexp.
func String ¶
String extracts all static parts from the given regexp. Returns a syntax error if regexp can't be parsed.
Example ¶
package main
import (
"fmt"
"github.com/bastjan/extractstatic"
)
func main() {
static, _ := extractstatic.String(`really\s?complicated.*regexp`)
fmt.Println(static)
}
Output: [really complicated regexp]
func StringLongest ¶
StringLongest extracts the longest static string from the given regexp. Returns a syntax error if regexp can't be parsed.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.