keyword/

directory
v1.27.0 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: Apache-2.0

README

ULIB Keyword

Fast wrapper for keyword lookup.

Example: Github

Regexp

Normal

package main

import (
	"fmt"

	"github.com/3JoB/ulib/keyword"
)

func main() {
	text := "hello world"
	kw := "world"
	fmt.Printf("RegexpFind: %v\n", keyword.RegexpFind(text, kw))
}

Compile:

package main

import (
    "fmt"

    "github.com/3JoB/ulib/keyword"
)

func main(){
    text := "hello world"
    text2 := "hello golang"
	kw := "world"
    re, _ := keyword.RegexpCompile(kw)
	reb, _ := re.Find(text)
	fmt.Printf("RegexpFind: %v\n", reb)
    reb2, _ := re.Find(text2)
	fmt.Printf("RegexpFind 2: %v\n", reb2)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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