3F / regXwild

⏱ Superfast ^Advanced wildcards++? | Unique algorithms that was implemented on native unmanaged C++ but easily accessible in .NET via Conari (with caching of 0x29 opcodes +optimizations) etc.
MIT License
27 stars 6 forks source link

is there python interface? #6

Closed SeekPoint closed 4 years ago

3F commented 4 years ago

Nothing special for python; at least for today.

For python you need ctypes use: https://docs.python.org/3/library/ctypes.html#module-ctypes

And since regXwild exports the following functions (C-mangling): https://github.com/3F/regXwild/blob/master/regXwild/regXwildAPI.h

For example, for:

bool searchEssC(const TCHAR* data, const TCHAR* filter, bool ignoreCase);

and for Unicode module (latest versions also distributed with MultiByte) it can be as below ~

import ctypes
regXwild = ctypes.cdll.LoadLibrary('regXwild.dll')

wstr  = ctypes.c_wchar_p("TV_[11_of_24]");
icase = ctypes.c_bool(0)

regXwild.searchEssC(wstr, ctypes.c_wchar_p("1?_*24"), icase)

Let me know if you still have some problems.

SeekPoint commented 4 years ago

Great