want to convert one freeswitch c code snippet into lua

hi in one of my module two freeswitch C language inbuilt-functions are being used in a function and that same function I need to convert into the lua script Two function are 1st is

int switch_regex_perform (const char *field, const char *expression, switch_regex_t **new_re, int *ovector, uint32_t olen) 

the link address of 1st function
https://docs.freeswitch.org/group__switch__regex.html#gad8c2d1d09bd64de96e00acfa1f4d93cc

and the second function is

void    switch_perform_substitution (switch_regex_t *re, int match_count, const char *data, const char *field_data, char *substituted, switch_size_t len, int *ovector)

the link address of second function:
https://docs.freeswitch.org/group__switch__regex.html#ga5e0b01069eb186f8e97f8c41a0afc1a2

I just want to know what the above functions do so that I can convert them into lua

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum