regify utility  2.0.0-0
regex.h
1 /*
2  * Copyright regify
3  *
4  * Permission is hereby granted, free of charge, to any person obtaining a copy
5  * of this software and associated documentation files (the "Software"), to deal
6  * in the Software without restriction, including without limitation the rights
7  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8  * copies of the Software, and to permit persons to whom the Software is
9  * furnished to do so, subject to the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included in
12  * all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20  * SOFTWARE.
21  */
28 #ifndef REGIFY_UTIL_REGEX_H
29 #define REGIFY_UTIL_REGEX_H
30 
31 /* Only need to export C interface if used by C++ source code */
32 #ifdef __cplusplus
33 extern "C" {
34 #endif /* __cplusplus */
35 
36 
70 typedef enum ruRegexFlag_ {
71 
74 
80 
83 
87 
97 
103 
109 
117 
125 
127 
131 typedef void* ruRegex;
132 
138 
149 RUAPI ruRegex ruRegexNew(const char* pattern, ruRegexFlag flags, int32_t* code);
150 
162 RUAPI char* ruRegexReplace(ruRegex rr, const char* original,
163  const char* replacement, int32_t* code);
164 
173 RUAPI bool ruRegexMatch(ruRegex rr, const char* original, int32_t* code);
174 
183 RUAPI bool ruRegexFind(ruRegex rr, const char* original, int32_t* code);
184 
193 RUAPI ruList ruRegexMatchGroups(ruRegex rr, const char* original, int32_t* code);
194 
203 RUAPI ruList ruRegexFindGroups(ruRegex rr, const char* original, int32_t* code);
204 
208 #ifdef __cplusplus
209 }
210 #endif /* __cplusplus */
211 #endif //REGIFY_UTIL_REGEX_H
void * ruList
Opaque pointer to list object. See List Collection.
Definition: list.h:103
RUAPI ruRegex ruRegexFree(ruRegex rr)
Frees up the resources of the given ruRegex object.
enum ruRegexFlag_ ruRegexFlag
Constants for Regular Expression Match Modes.
RUAPI bool ruRegexMatch(ruRegex rr, const char *original, int32_t *code)
Indicates whether the given original matches the entire expression in rr.
RUAPI ruList ruRegexFindGroups(ruRegex rr, const char *original, int32_t *code)
Returns the matches found in the given original if it matched part of the expression in rr.
void * ruRegex
Opaque pointer to regular expression object.
Definition: regex.h:131
ruRegexFlag_
Constants for Regular Expression Match Modes.
Definition: regex.h:70
RUAPI ruRegex ruRegexNew(const char *pattern, ruRegexFlag flags, int32_t *code)
Creates a new regular expression object to be used with ruRegex(Replace|Match|...) free with ruRegexF...
RUAPI char * ruRegexReplace(ruRegex rr, const char *original, const char *replacement, int32_t *code)
Replace the found expression instances in original with the content found in replacement and return t...
RUAPI bool ruRegexFind(ruRegex rr, const char *original, int32_t *code)
Indicates whether the given original matches the part of the expression in rr.
RUAPI ruList ruRegexMatchGroups(ruRegex rr, const char *original, int32_t *code)
Returns the matches found in the given original if it matched the entire expression in rr.
@ RUREGEX_UWORD
Definition: regex.h:116
@ RUREGEX_ERROR_ON_UNKNOWN_ESCAPES
Definition: regex.h:124
@ RUREGEX_MULTILINE
Definition: regex.h:102
@ RUREGEX_COMMENTS
Definition: regex.h:82
@ RUREGEX_CANON_EQ
Definition: regex.h:77
@ RUREGEX_LITERAL
Definition: regex.h:96
@ RUREGEX_NULL
Definition: regex.h:73
@ RUREGEX_CASE_INSENSITIVE
Definition: regex.h:79
@ RUREGEX_DOTALL
Definition: regex.h:86
@ RUREGEX_UNIX_LINES
Definition: regex.h:108