Skip to content

Missing documentation #440

@JeremieIntel

Description

@JeremieIntel

I'm trying to run Hyperscan in python but there is absolutely no documentation on how to run it.
I'm missing an "hello world" example on how to use it.
What i have is:

pattern ="He"
match_found = []
db = hyperscan.Database()
       db.compile(
           expressions=[pattern.encode('utf-8')],
           flags=hyperscan.HS_FLAG_CASELESS
       )
 def on_match(id, from_, to, flags, context):
           context.append(True)
           return True
if db.scan("hello world!".encode(utf-8), on_match, context=match_found)
  print"match found")

but it doesn't work because db.scan() returns None

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions