regcomp method
Compile regex
Implementation
int regcomp(regex_t preg, String regex, int cflags) {
try {
bool caseSensitive = (cflags & REG_ICASE) == 0;
bool multiLine = (cflags & REG_NEWLINE) != 0;
preg.re = RegExp(regex, caseSensitive: caseSensitive, multiLine: multiLine);
preg.cflags = cflags;
return 0;
} catch (_) {
return REG_BADPAT;
}
}