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{
00051 UREGEX_CANON_EQ = 128,
00052
00054 UREGEX_CASE_INSENSITIVE = 2,
00055
00057 UREGEX_COMMENTS = 4,
00058
00061 UREGEX_DOTALL = 32,
00062
00067 UREGEX_MULTILINE = 8,
00068
00076 UREGEX_UWORD = 256
00077 } URegexpFlag;
00078
00100 U_DRAFT URegularExpression * U_EXPORT2
00101 uregex_open( const UChar *pattern,
00102 int32_t patternLength,
00103 uint32_t flags,
00104 UParseError *pe,
00105 UErrorCode *status);
00106
00130 U_DRAFT URegularExpression * U_EXPORT2
00131 uregex_openC( const char *pattern,
00132 uint32_t flags,
00133 UParseError *pe,
00134 UErrorCode *status);
00135
00136
00137
00138
00146 U_DRAFT void U_EXPORT2
00147 uregex_close(URegularExpression *regexp);
00148
00167 U_DRAFT URegularExpression * U_EXPORT2
00168 uregex_clone(const URegularExpression *regexp, UErrorCode *status);
00169
00186 U_DRAFT const UChar * U_EXPORT2
00187 uregex_pattern(const URegularExpression *regexp,
00188 int32_t *patLength,
00189 UErrorCode *status);
00190
00191
00200 U_DRAFT int32_t U_EXPORT2
00201 uregex_flags(const URegularExpression *regexp,
00202 UErrorCode *status);
00203
00204
00225 U_DRAFT void U_EXPORT2
00226 uregex_setText(URegularExpression *regexp,
00227 const UChar *text,
00228 int32_t textLength,
00229 UErrorCode *status);
00230
00247 U_DRAFT const UChar * U_EXPORT2
00248 uregex_getText(URegularExpression *regexp,
00249 int32_t *textLength,
00250 UErrorCode *status);
00251
00262 U_DRAFT UBool U_EXPORT2
00263 uregex_matches(URegularExpression *regexp,
00264 int32_t startIndex,
00265 UErrorCode *status);
00266
00282 U_DRAFT UBool U_EXPORT2
00283 uregex_lookingAt(URegularExpression *regexp,
00284 int32_t startIndex,
00285 UErrorCode *status);
00286
00299 U_DRAFT UBool U_EXPORT2
00300 uregex_find(URegularExpression *regexp,
00301 int32_t startIndex,
00302 UErrorCode *status);
00303
00317 U_DRAFT UBool U_EXPORT2
00318 uregex_findNext(URegularExpression *regexp,
00319 UErrorCode *status);
00320
00328 U_DRAFT int32_t U_EXPORT2
00329 uregex_groupCount(URegularExpression *regexp,
00330 UErrorCode *status);
00331
00348 U_DRAFT int32_t U_EXPORT2
00349 uregex_group(URegularExpression *regexp,
00350 int32_t groupNum,
00351 UChar *dest,
00352 int32_t destCapacity,
00353 UErrorCode *status);
00354
00355
00370 U_DRAFT int32_t U_EXPORT2
00371 uregex_start(URegularExpression *regexp,
00372 int32_t groupNum,
00373 UErrorCode *status);
00374
00388 U_DRAFT int32_t U_EXPORT2
00389 uregex_end(URegularExpression *regexp,
00390 int32_t groupNum,
00391 UErrorCode *status);
00392
00405 U_DRAFT void U_EXPORT2
00406 uregex_reset(URegularExpression *regexp,
00407 int32_t index,
00408 UErrorCode *status);
00409
00434 U_DRAFT int32_t U_EXPORT2
00435 uregex_replaceAll(URegularExpression *regexp,
00436 UChar *replacementText,
00437 int32_t replacementLength,
00438 UChar *destBuf,
00439 int32_t destCapacity,
00440 UErrorCode *status);
00441
00442
00467 U_DRAFT int32_t U_EXPORT2
00468 uregex_replaceFirst(URegularExpression *regexp,
00469 UChar *replacementText,
00470 int32_t replacementLength,
00471 UChar *destBuf,
00472 int32_t destCapacity,
00473 UErrorCode *status);
00474
00475
00522 U_DRAFT int32_t U_EXPORT2
00523 uregex_appendReplacement(URegularExpression *regexp,
00524 UChar *replacementText,
00525 int32_t replacementLength,
00526 UChar **destBuf,
00527 int32_t *destCapacity,
00528 UErrorCode *status);
00529
00530
00555 U_DRAFT int32_t U_EXPORT2
00556 uregex_appendTail(URegularExpression *regexp,
00557 UChar **destBuf,
00558 int32_t *destCapacity,
00559 UErrorCode *status);
00560
00561
00562
00563
00618 U_DRAFT int32_t U_EXPORT2
00619 uregex_split( URegularExpression *regexp,
00620 UChar *destBuf,
00621 int32_t destCapacity,
00622 int32_t *requiredCapacity,
00623 UChar *destFields[],
00624 int32_t destFieldsCapacity,
00625 UErrorCode *status);
00626
00627
00628
00629 #endif
00630 #endif