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
00074 UREGEX_LITERAL = 16,
00075
00080 UREGEX_MULTILINE = 8,
00081
00087 UREGEX_UNIX_LINES = 1,
00088
00096 UREGEX_UWORD = 256,
00097
00105 UREGEX_ERROR_ON_UNKNOWN_ESCAPES = 512
00106
00107 } URegexpFlag;
00108
00130 U_STABLE URegularExpression * U_EXPORT2
00131 uregex_open( const UChar *pattern,
00132 int32_t patternLength,
00133 uint32_t flags,
00134 UParseError *pe,
00135 UErrorCode *status);
00136
00160 #if !UCONFIG_NO_CONVERSION
00161 U_STABLE URegularExpression * U_EXPORT2
00162 uregex_openC( const char *pattern,
00163 uint32_t flags,
00164 UParseError *pe,
00165 UErrorCode *status);
00166 #endif
00167
00168
00169
00177 U_STABLE void U_EXPORT2
00178 uregex_close(URegularExpression *regexp);
00179
00198 U_STABLE URegularExpression * U_EXPORT2
00199 uregex_clone(const URegularExpression *regexp, UErrorCode *status);
00200
00217 U_STABLE const UChar * U_EXPORT2
00218 uregex_pattern(const URegularExpression *regexp,
00219 int32_t *patLength,
00220 UErrorCode *status);
00221
00222
00231 U_STABLE int32_t U_EXPORT2
00232 uregex_flags(const URegularExpression *regexp,
00233 UErrorCode *status);
00234
00235
00256 U_STABLE void U_EXPORT2
00257 uregex_setText(URegularExpression *regexp,
00258 const UChar *text,
00259 int32_t textLength,
00260 UErrorCode *status);
00261
00278 U_STABLE const UChar * U_EXPORT2
00279 uregex_getText(URegularExpression *regexp,
00280 int32_t *textLength,
00281 UErrorCode *status);
00282
00303 U_STABLE UBool U_EXPORT2
00304 uregex_matches(URegularExpression *regexp,
00305 int32_t startIndex,
00306 UErrorCode *status);
00307
00331 U_STABLE UBool U_EXPORT2
00332 uregex_lookingAt(URegularExpression *regexp,
00333 int32_t startIndex,
00334 UErrorCode *status);
00335
00355 U_STABLE UBool U_EXPORT2
00356 uregex_find(URegularExpression *regexp,
00357 int32_t startIndex,
00358 UErrorCode *status);
00359
00373 U_STABLE UBool U_EXPORT2
00374 uregex_findNext(URegularExpression *regexp,
00375 UErrorCode *status);
00376
00384 U_STABLE int32_t U_EXPORT2
00385 uregex_groupCount(URegularExpression *regexp,
00386 UErrorCode *status);
00387
00404 U_STABLE int32_t U_EXPORT2
00405 uregex_group(URegularExpression *regexp,
00406 int32_t groupNum,
00407 UChar *dest,
00408 int32_t destCapacity,
00409 UErrorCode *status);
00410
00411
00426 U_STABLE int32_t U_EXPORT2
00427 uregex_start(URegularExpression *regexp,
00428 int32_t groupNum,
00429 UErrorCode *status);
00430
00444 U_STABLE int32_t U_EXPORT2
00445 uregex_end(URegularExpression *regexp,
00446 int32_t groupNum,
00447 UErrorCode *status);
00448
00462 U_STABLE void U_EXPORT2
00463 uregex_reset(URegularExpression *regexp,
00464 int32_t index,
00465 UErrorCode *status);
00466
00467
00487 U_DRAFT void U_EXPORT2
00488 uregex_setRegion(URegularExpression *regexp,
00489 int32_t regionStart,
00490 int32_t regionLimit,
00491 UErrorCode *status);
00492
00502 U_DRAFT int32_t U_EXPORT2
00503 uregex_regionStart(const URegularExpression *regexp,
00504 UErrorCode *status);
00505
00506
00507
00518 U_DRAFT int32_t U_EXPORT2
00519 uregex_regionEnd(const URegularExpression *regexp,
00520 UErrorCode *status);
00521
00532 U_DRAFT UBool U_EXPORT2
00533 uregex_hasTransparentBounds(const URegularExpression *regexp,
00534 UErrorCode *status);
00535
00536
00556 U_DRAFT void U_EXPORT2
00557 uregex_useTransparentBounds(URegularExpression *regexp,
00558 UBool b,
00559 UErrorCode *status);
00560
00561
00571 U_DRAFT UBool U_EXPORT2
00572 uregex_hasAnchoringBounds(const URegularExpression *regexp,
00573 UErrorCode *status);
00574
00575
00589 U_DRAFT void U_EXPORT2
00590 uregex_useAnchoringBounds(URegularExpression *regexp,
00591 UBool b,
00592 UErrorCode *status);
00593
00604 U_DRAFT UBool U_EXPORT2
00605 uregex_hitEnd(const URegularExpression *regexp,
00606 UErrorCode *status);
00607
00619 U_DRAFT UBool U_EXPORT2
00620 uregex_requireEnd(const URegularExpression *regexp,
00621 UErrorCode *status);
00622
00623
00624
00625
00626
00651 U_STABLE int32_t U_EXPORT2
00652 uregex_replaceAll(URegularExpression *regexp,
00653 const UChar *replacementText,
00654 int32_t replacementLength,
00655 UChar *destBuf,
00656 int32_t destCapacity,
00657 UErrorCode *status);
00658
00659
00684 U_STABLE int32_t U_EXPORT2
00685 uregex_replaceFirst(URegularExpression *regexp,
00686 const UChar *replacementText,
00687 int32_t replacementLength,
00688 UChar *destBuf,
00689 int32_t destCapacity,
00690 UErrorCode *status);
00691
00692
00739 U_STABLE int32_t U_EXPORT2
00740 uregex_appendReplacement(URegularExpression *regexp,
00741 const UChar *replacementText,
00742 int32_t replacementLength,
00743 UChar **destBuf,
00744 int32_t *destCapacity,
00745 UErrorCode *status);
00746
00747
00772 U_STABLE int32_t U_EXPORT2
00773 uregex_appendTail(URegularExpression *regexp,
00774 UChar **destBuf,
00775 int32_t *destCapacity,
00776 UErrorCode *status);
00777
00778
00779
00780
00835 U_STABLE int32_t U_EXPORT2
00836 uregex_split( URegularExpression *regexp,
00837 UChar *destBuf,
00838 int32_t destCapacity,
00839 int32_t *requiredCapacity,
00840 UChar *destFields[],
00841 int32_t destFieldsCapacity,
00842 UErrorCode *status);
00843
00844
00845
00846
00869 U_DRAFT void U_EXPORT2
00870 uregex_setTimeLimit(URegularExpression *regexp,
00871 int32_t limit,
00872 UErrorCode *status);
00873
00883 U_DRAFT int32_t U_EXPORT2
00884 uregex_getTimeLimit(const URegularExpression *regexp,
00885 UErrorCode *status);
00886
00907 U_DRAFT void U_EXPORT2
00908 uregex_setStackLimit(URegularExpression *regexp,
00909 int32_t limit,
00910 UErrorCode *status);
00911
00919 U_DRAFT int32_t U_EXPORT2
00920 uregex_getStackLimit(const URegularExpression *regexp,
00921 UErrorCode *status);
00922
00923
00942 U_CDECL_BEGIN
00943 typedef UBool U_CALLCONV URegexMatchCallback (
00944 const void *context,
00945 int32_t steps);
00946 U_CDECL_END
00947
00962 U_DRAFT void U_EXPORT2
00963 uregex_setMatchCallback(URegularExpression *regexp,
00964 URegexMatchCallback *callback,
00965 const void *context,
00966 UErrorCode *status);
00967
00968
00980 U_DRAFT void U_EXPORT2
00981 uregex_getMatchCallback(const URegularExpression *regexp,
00982 URegexMatchCallback **callback,
00983 const void **context,
00984 UErrorCode *status);
00985
00986
00987
00988 #endif
00989 #endif