Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use it by right method? #23

Closed
FelixSeptem opened this issue Jun 7, 2020 · 2 comments
Closed

How to use it by right method? #23

FelixSeptem opened this issue Jun 7, 2020 · 2 comments

Comments

@FelixSeptem
Copy link

FelixSeptem commented Jun 7, 2020

My demand is to match one string to multi regex. And I write code below, I get a Database and what shall I do next?I don't find right method to call in Database or I missed something?

package main

import "github.com/flier/gohs/hyperscan"

func main(){
    regs := []hyperscan.Expression{
        hyperscan.Expression("..."),
        hyperscan.Expression("..."),
    }
    db := new(hyperscan.DatabaseBuilder)
    db.AddExpressions(regs...).Build()
    // what shall I do next? is there some method like db.Match("target string") or something?
}
@flier
Copy link
Owner

flier commented Jun 8, 2020

It depends on how you want to use it, for example, you can specify the generate BlockDatabase with BlockMode (ModeFlag).

Please check the unit test for more detail.

@FelixSeptem
Copy link
Author

It depends on how you want to use it, for example, you can specify the generate BlockDatabase with BlockMode (ModeFlag).

Please check the unit test for more detail.

not really help for me, my question is not found the right method to call in struct Database, which is generated by DatabaseBuilder.Build()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants