Quickjs_c.LibregexpLow-level bindings to QuickJS's libregexp - Regular Expression Engine
ES2023-compliant regex engine with Unicode support. These are raw C bindings; for a higher-level API, use Quickjs.RegExp.
val compile :
int Ctypes_static.ptr ->
char Ctypes_static.ptr ->
int ->
string Ctypes_static.ocaml ->
Unsigned.size_t ->
int ->
unit Ctypes_static.ptr ->
Unsigned.uint8 Ctypes_static.ptr
Quickjs_bindings.Libregexp__c_generated_functions__Function_description__Functions.returnCompile a regular expression pattern into bytecode. Returns pointer to bytecode buffer, or NULL on error with message in error_msg. The buffer must be released with bytecode_free.
val exec :
Unsigned.uint8 Ctypes_static.ptr Ctypes_static.ptr ->
Unsigned.uint8 Ctypes_static.ptr ->
Unsigned.uint8 Ctypes_static.ptr ->
int ->
int ->
int ->
float Ctypes_static.ptr option ->
int
Quickjs_bindings.Libregexp__c_generated_functions__Function_description__Functions.returnExecute a compiled regex against input string. deadline is an optional pointer to a monotonic deadline in milliseconds (see now_ms). Returns: 1 = match, 0 = no match, -1 = memory error, -2 = timeout
val bytecode_free :
Unsigned.uint8 Ctypes_static.ptr ->
unit
Quickjs_bindings.Libregexp__c_generated_functions__Function_description__Functions.returnFree a bytecode buffer returned by compile
val now_ms :
unit ->
float
Quickjs_bindings.Libregexp__c_generated_functions__Function_description__Functions.returnMonotonic clock in milliseconds; basis for exec deadlines
val get_capture_count :
Unsigned.uint8 Ctypes_static.ptr ->
int
Quickjs_bindings.Libregexp__c_generated_functions__Function_description__Functions.returnGet number of capture groups (including group 0 for full match)
val get_groupnames :
Unsigned.uint8 Ctypes_static.ptr ->
char Ctypes_static.ptr option
Quickjs_bindings.Libregexp__c_generated_functions__Function_description__Functions.returnGet pointer to null-terminated group names
val get_flags :
Unsigned.uint8 Ctypes_static.ptr ->
int
Quickjs_bindings.Libregexp__c_generated_functions__Function_description__Functions.returnGet flags from compiled bytecode