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
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:
but it doesn't work because db.scan() returns None