PPL Logo

util/ckregex.h File Reference

Go to the source code of this file.

Functions

char ** findFirstCaptures (const char *pattern, const char *s)
 This file defines APIs for regular expression calls.


Function Documentation

char** findFirstCaptures ( const char *  pattern,
const char *  s 
)

This file defines APIs for regular expression calls.

Current implementation is c++11 regex library that should be well supported across platform.

Author:
Shaoqin(Bobby) Lu find captures in the first matched substring using the provided regular expression pattern on the target string.
TODO this feels a little not as flexible. Maybe make a function that takes int n to find first n matches and all captures

example: pattern="abcd([0-9]+)" s="abcd1234abcd5678" return ["1234", NULL]

Parameters:
pattern the regular expression pattern
s the target string
Returns:
An array of string representing the captured substrings terminated with a NULL, caller is responsible to free the consumed memory

Definition at line 6 of file ckregex.C.

References malloc(), match(), PUP::s, and strdup().

Here is the call graph for this function:


Generated on Mon Sep 21 08:11:40 2020 for Charm++ by  doxygen 1.5.5