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 struct URegularExpression;
00038 typedef struct URegularExpression URegularExpression;
00039
00040
00045 typedef enum URegexpFlag{
00046
00047 #ifndef U_HIDE_DRAFT_API
00048
00051 UREGEX_CANON_EQ = 128,
00052 #endif
00053
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_STABLE 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 #if !UCONFIG_NO_CONVERSION
00131 U_STABLE URegularExpression * U_EXPORT2
00132 uregex_openC( const char *pattern,
00133 uint32_t flags,
00134 UParseError *pe,
00135 UErrorCode *status);
00136 #endif
00137
00138
00139
00147 U_STABLE void U_EXPORT2
00148 uregex_close(URegularExpression *regexp);
00149
00168 U_STABLE URegularExpression * U_EXPORT2
00169 uregex_clone(const URegularExpression *regexp, UErrorCode *status);
00170
00187 U_STABLE const UChar * U_EXPORT2
00188 uregex_pattern(const URegularExpression *regexp,
00189 int32_t *patLength,
00190 UErrorCode *status);
00191
00192
00201 U_STABLE int32_t U_EXPORT2
00202 uregex_flags(const URegularExpression *regexp,
00203 UErrorCode *status);
00204
00205
00226 U_STABLE void U_EXPORT2
00227 uregex_setText(URegularExpression *regexp,
00228 const UChar *text,
00229 int32_t textLength,
00230 UErrorCode *status);
00231
00248 U_STABLE const UChar * U_EXPORT2
00249 uregex_getText(URegularExpression *regexp,
00250 int32_t *textLength,
00251 UErrorCode *status);
00252
00263 U_STABLE UBool U_EXPORT2
00264 uregex_matches(URegularExpression *regexp,
00265 int32_t startIndex,
00266 UErrorCode *status);
00267
00283 U_STABLE UBool U_EXPORT2
00284 uregex_lookingAt(URegularExpression *regexp,
00285 int32_t startIndex,
00286 UErrorCode *status);
00287
00300 U_STABLE UBool U_EXPORT2
00301 uregex_find(URegularExpression *regexp,
00302 int32_t startIndex,
00303 UErrorCode *status);
00304
00318 U_STABLE UBool U_EXPORT2
00319 uregex_findNext(URegularExpression *regexp,
00320 UErrorCode *status);
00321
00329 U_STABLE int32_t U_EXPORT2
00330 uregex_groupCount(URegularExpression *regexp,
00331 UErrorCode *status);
00332
00349 U_STABLE int32_t U_EXPORT2
00350 uregex_group(URegularExpression *regexp,
00351 int32_t groupNum,
00352 UChar *dest,
00353 int32_t destCapacity,
00354 UErrorCode *status);
00355
00356
00371 U_STABLE int32_t U_EXPORT2
00372 uregex_start(URegularExpression *regexp,
00373 int32_t groupNum,
00374 UErrorCode *status);
00375
00389 U_STABLE int32_t U_EXPORT2
00390 uregex_end(URegularExpression *regexp,
00391 int32_t groupNum,
00392 UErrorCode *status);
00393
00406 U_STABLE void U_EXPORT2
00407 uregex_reset(URegularExpression *regexp,
00408 int32_t index,
00409 UErrorCode *status);
00410
00435 U_STABLE int32_t U_EXPORT2
00436 uregex_replaceAll(URegularExpression *regexp,
00437 const UChar *replacementText,
00438 int32_t replacementLength,
00439 UChar *destBuf,
00440 int32_t destCapacity,
00441 UErrorCode *status);
00442
00443
00468 U_STABLE int32_t U_EXPORT2
00469 uregex_replaceFirst(URegularExpression *regexp,
00470 const UChar *replacementText,
00471 int32_t replacementLength,
00472 UChar *destBuf,
00473 int32_t destCapacity,
00474 UErrorCode *status);
00475
00476
00523 U_STABLE int32_t U_EXPORT2
00524 uregex_appendReplacement(URegularExpression *regexp,
00525 const UChar *replacementText,
00526 int32_t replacementLength,
00527 UChar **destBuf,
00528 int32_t *destCapacity,
00529 UErrorCode *status);
00530
00531
00556 U_STABLE int32_t U_EXPORT2
00557 uregex_appendTail(URegularExpression *regexp,
00558 UChar **destBuf,
00559 int32_t *destCapacity,
00560 UErrorCode *status);
00561
00562
00563
00564
00619 U_STABLE int32_t U_EXPORT2
00620 uregex_split( URegularExpression *regexp,
00621 UChar *destBuf,
00622 int32_t destCapacity,
00623 int32_t *requiredCapacity,
00624 UChar *destFields[],
00625 int32_t destFieldsCapacity,
00626 UErrorCode *status);
00627
00628
00629
00630 #endif
00631 #endif