00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00023 #ifndef UREGEX_H
00024 #define UREGEX_H
00025
00026 #include "unicode/utypes.h"
00027
00028 #if !UCONFIG_NO_REGULAR_EXPRESSIONS
00029
00030 #include "unicode/parseerr.h"
00031
00032 #ifndef U_HIDE_DRAFT_API
00033
00034 struct URegularExpression;
00040 typedef struct URegularExpression URegularExpression;
00041
00042 #endif
00043
00044
00049 typedef enum URegexpFlag{
00053 UREGEX_CANON_EQ = 128,
00054
00056 UREGEX_CASE_INSENSITIVE = 2,
00057
00059 UREGEX_COMMENTS = 4,
00060
00063 UREGEX_DOTALL = 32,
00064
00069 UREGEX_MULTILINE = 8,
00070
00078 UREGEX_UWORD = 256
00079 } URegexpFlag;
00080
00102 U_DRAFT URegularExpression * U_EXPORT2
00103 uregex_open( const UChar *pattern,
00104 int32_t patternLength,
00105 uint32_t flags,
00106 UParseError *pe,
00107 UErrorCode *status);
00108
00132 #if !UCONFIG_NO_CONVERSION
00133 U_DRAFT URegularExpression * U_EXPORT2
00134 uregex_openC( const char *pattern,
00135 uint32_t flags,
00136 UParseError *pe,
00137 UErrorCode *status);
00138 #endif
00139
00140
00141
00149 U_DRAFT void U_EXPORT2
00150 uregex_close(URegularExpression *regexp);
00151
00170 U_DRAFT URegularExpression * U_EXPORT2
00171 uregex_clone(const URegularExpression *regexp, UErrorCode *status);
00172
00189 U_DRAFT const UChar * U_EXPORT2
00190 uregex_pattern(const URegularExpression *regexp,
00191 int32_t *patLength,
00192 UErrorCode *status);
00193
00194
00203 U_DRAFT int32_t U_EXPORT2
00204 uregex_flags(const URegularExpression *regexp,
00205 UErrorCode *status);
00206
00207
00228 U_DRAFT void U_EXPORT2
00229 uregex_setText(URegularExpression *regexp,
00230 const UChar *text,
00231 int32_t textLength,
00232 UErrorCode *status);
00233
00250 U_DRAFT const UChar * U_EXPORT2
00251 uregex_getText(URegularExpression *regexp,
00252 int32_t *textLength,
00253 UErrorCode *status);
00254
00265 U_DRAFT UBool U_EXPORT2
00266 uregex_matches(URegularExpression *regexp,
00267 int32_t startIndex,
00268 UErrorCode *status);
00269
00285 U_DRAFT UBool U_EXPORT2
00286 uregex_lookingAt(URegularExpression *regexp,
00287 int32_t startIndex,
00288 UErrorCode *status);
00289
00302 U_DRAFT UBool U_EXPORT2
00303 uregex_find(URegularExpression *regexp,
00304 int32_t startIndex,
00305 UErrorCode *status);
00306
00320 U_DRAFT UBool U_EXPORT2
00321 uregex_findNext(URegularExpression *regexp,
00322 UErrorCode *status);
00323
00331 U_DRAFT int32_t U_EXPORT2
00332 uregex_groupCount(URegularExpression *regexp,
00333 UErrorCode *status);
00334
00351 U_DRAFT int32_t U_EXPORT2
00352 uregex_group(URegularExpression *regexp,
00353 int32_t groupNum,
00354 UChar *dest,
00355 int32_t destCapacity,
00356 UErrorCode *status);
00357
00358
00373 U_DRAFT int32_t U_EXPORT2
00374 uregex_start(URegularExpression *regexp,
00375 int32_t groupNum,
00376 UErrorCode *status);
00377
00391 U_DRAFT int32_t U_EXPORT2
00392 uregex_end(URegularExpression *regexp,
00393 int32_t groupNum,
00394 UErrorCode *status);
00395
00408 U_DRAFT void U_EXPORT2
00409 uregex_reset(URegularExpression *regexp,
00410 int32_t index,
00411 UErrorCode *status);
00412
00437 U_DRAFT int32_t U_EXPORT2
00438 uregex_replaceAll(URegularExpression *regexp,
00439 const UChar *replacementText,
00440 int32_t replacementLength,
00441 UChar *destBuf,
00442 int32_t destCapacity,
00443 UErrorCode *status);
00444
00445
00470 U_DRAFT int32_t U_EXPORT2
00471 uregex_replaceFirst(URegularExpression *regexp,
00472 const UChar *replacementText,
00473 int32_t replacementLength,
00474 UChar *destBuf,
00475 int32_t destCapacity,
00476 UErrorCode *status);
00477
00478
00525 U_DRAFT int32_t U_EXPORT2
00526 uregex_appendReplacement(URegularExpression *regexp,
00527 const UChar *replacementText,
00528 int32_t replacementLength,
00529 UChar **destBuf,
00530 int32_t *destCapacity,
00531 UErrorCode *status);
00532
00533
00558 U_DRAFT int32_t U_EXPORT2
00559 uregex_appendTail(URegularExpression *regexp,
00560 UChar **destBuf,
00561 int32_t *destCapacity,
00562 UErrorCode *status);
00563
00564
00565
00566
00621 U_DRAFT int32_t U_EXPORT2
00622 uregex_split( URegularExpression *regexp,
00623 UChar *destBuf,
00624 int32_t destCapacity,
00625 int32_t *requiredCapacity,
00626 UChar *destFields[],
00627 int32_t destFieldsCapacity,
00628 UErrorCode *status);
00629
00630
00631
00632 #endif
00633 #endif