1f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/*
2f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)**********************************************************************
3f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)*   Copyright (C) 2004-2010, International Business Machines
4f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)*   Corporation and others.  All Rights Reserved.
5f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)**********************************************************************
6f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)*   file name:  uregex.h
7f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)*   encoding:   US-ASCII
8f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)*   indentation:4
9f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)*
10f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)*   created on: 2004mar09
11f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)*   created by: Andy Heninger
12f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)*
13f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)*   ICU Regular Expressions, API for C
14f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)*/
15f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
16f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
17f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * \file
18f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * \brief C API: Regular Expressions
19f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
20f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * <p>This is a C wrapper around the C++ RegexPattern and RegexMatcher classes.</p>
21f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) */
22f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
23f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)#ifndef UREGEX_H
24f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)#define UREGEX_H
25f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
26f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)#include "unicode/utext.h"
27f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)#include "unicode/utypes.h"
28f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
29f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)#if !UCONFIG_NO_REGULAR_EXPRESSIONS
30f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
31f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)#include "unicode/localpointer.h"
32f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)#include "unicode/parseerr.h"
33f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
34f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)struct URegularExpression;
35f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
36f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Structure representing a compiled regular rexpression, plus the results
37f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    of a match operation.
38f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @stable ICU 3.0
39f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
40f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)typedef struct URegularExpression URegularExpression;
41f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
42f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
43f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
44f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * Constants for Regular Expression Match Modes.
45f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @stable ICU 2.4
46f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) */
47f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)typedef enum URegexpFlag{
48f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
49f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)#ifndef U_HIDE_DRAFT_API
50f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    /** Forces normalization of pattern and strings.
51f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    Not implemented yet, just a placeholder, hence draft.
52f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    @draft ICU 2.4 */
53f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    UREGEX_CANON_EQ         = 128,
54f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)#endif
55f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    /**  Enable case insensitive matching.  @stable ICU 2.4 */
56f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    UREGEX_CASE_INSENSITIVE = 2,
57f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
58f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    /**  Allow white space and comments within patterns  @stable ICU 2.4 */
59f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    UREGEX_COMMENTS         = 4,
60f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
61f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    /**  If set, '.' matches line terminators,  otherwise '.' matching stops at line end.
62f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *  @stable ICU 2.4 */
63f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    UREGEX_DOTALL           = 32,
64f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
65f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    /**  If set, treat the entire pattern as a literal string.
66f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *  Metacharacters or escape sequences in the input sequence will be given
67f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *  no special meaning. Not implemented yet as of ICU 4.4.
68f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *
69f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *  The flags CASE_INSENSITIVE and UNICODE_CASE retain their impact
70f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *  on matching when used in conjunction with this flag.
71f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *  The other flags become superfluous.
72f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *  TODO:  say which escapes are still handled; anything Java does
73f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *         early (\\u) we should still do.
74f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      * @stable ICU 4.0
75f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      */
76f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    UREGEX_LITERAL = 16,
77f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
78f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    /**   Control behavior of "$" and "^"
79f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *    If set, recognize line terminators within string,
80f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *    otherwise, match only at start and end of input string.
81f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *   @stable ICU 2.4 */
82f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    UREGEX_MULTILINE        = 8,
83f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
84f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    /**   Unix-only line endings.
85f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *   When this mode is enabled, only \\u000a is recognized as a line ending
86f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *    in the behavior of ., ^, and $.
87f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *   @stable ICU 4.0
88f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      */
89f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    UREGEX_UNIX_LINES = 1,
90f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
91f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    /**  Unicode word boundaries.
92f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *     If set, \b uses the Unicode TR 29 definition of word boundaries.
93f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *     Warning: Unicode word boundaries are quite different from
94f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *     traditional regular expression word boundaries.  See
95f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *     http://unicode.org/reports/tr29/#Word_Boundaries
96f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      *     @stable ICU 2.8
97f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)      */
98f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)    UREGEX_UWORD            = 256,
99f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
100f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)     /**  Error on Unrecognized backslash escapes.
101f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)       *     If set, fail with an error on patterns that contain
102f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)       *     backslash-escaped ASCII letters without a known specail
103f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)       *     meaning.  If this flag is not set, these
104f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)       *     escaped letters represent themselves.
105f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)       *     @stable ICU 4.0
106f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)       */
107f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)     UREGEX_ERROR_ON_UNKNOWN_ESCAPES = 512
108f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
109f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)}  URegexpFlag;
110f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
111f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
112f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  Open (compile) an ICU regular expression.  Compiles the regular expression in
113f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  string form into an internal representation using the specified match mode flags.
114f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  The resulting regular expression handle can then be used to perform various
115f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   matching operations.
116f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
117f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
118f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param pattern        The Regular Expression pattern to be compiled.
119f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param patternLength  The length of the pattern, or -1 if the pattern is
120f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       NUL termintated.
121f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param flags          Flags that alter the default matching behavior for
122f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       the regular expression, UREGEX_CASE_INSENSITIVE, for
123f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       example.  For default behavior, set this parameter to zero.
124f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       See <code>enum URegexpFlag</code>.  All desired flags
125f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       are bitwise-ORed together.
126f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param pe             Receives the position (line and column nubers) of any syntax
127f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       error within the source regular expression string.  If this
128f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       information is not wanted, pass NULL for this parameter.
129f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param status         Receives error detected by this function.
130f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @stable ICU 3.0
131f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
132f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
133f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE URegularExpression * U_EXPORT2
134f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_open( const  UChar          *pattern,
135f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                    int32_t         patternLength,
136f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                    uint32_t        flags,
137f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                    UParseError    *pe,
138f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                    UErrorCode     *status);
139f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
140f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
141f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  Open (compile) an ICU regular expression.  Compiles the regular expression in
142f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  string form into an internal representation using the specified match mode flags.
143f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  The resulting regular expression handle can then be used to perform various
144f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   matching operations.
145f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  <p>
146f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  The contents of the pattern UText will be extracted and saved. Ownership of the
147f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   UText struct itself remains with the caller. This is to match the behavior of
148f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   uregex_open().
149f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
150f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param pattern        The Regular Expression pattern to be compiled.
151f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param flags          Flags that alter the default matching behavior for
152f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       the regular expression, UREGEX_CASE_INSENSITIVE, for
153f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       example.  For default behavior, set this parameter to zero.
154f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       See <code>enum URegexpFlag</code>.  All desired flags
155f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       are bitwise-ORed together.
156f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param pe             Receives the position (line and column nubers) of any syntax
157f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       error within the source regular expression string.  If this
158f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       information is not wanted, pass NULL for this parameter.
159f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param status         Receives error detected by this function.
160f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
161f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @draft ICU 4.6
162f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
163f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT URegularExpression *  U_EXPORT2
164f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_openUText(UText          *pattern,
165f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                 uint32_t        flags,
166f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                 UParseError    *pe,
167f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                 UErrorCode     *status);
168f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
169f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
170f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  Open (compile) an ICU regular expression.  The resulting regular expression
171f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   handle can then be used to perform various matching operations.
172f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  <p>
173f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   This function is the same as uregex_open, except that the pattern
174f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   is supplied as an 8 bit char * string in the default code page.
175f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
176f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param pattern        The Regular Expression pattern to be compiled,
177f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       NUL termintated.
178f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param flags          Flags that alter the default matching behavior for
179f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       the regular expression, UREGEX_CASE_INSENSITIVE, for
180f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       example.  For default behavior, set this parameter to zero.
181f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       See <code>enum URegexpFlag</code>.  All desired flags
182f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       are bitwise-ORed together.
183f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param pe             Receives the position (line and column nubers) of any syntax
184f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       error within the source regular expression string.  If this
185f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       information is not wanted, pass NULL for this parameter.
186f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param status         Receives errors detected by this function.
187f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @return               The URegularExpression object representing the compiled
188f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                       pattern.
189f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
190f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @stable ICU 3.0
191f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
192f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)#if !UCONFIG_NO_CONVERSION
193f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE URegularExpression * U_EXPORT2
194f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_openC( const char           *pattern,
195f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                    uint32_t        flags,
196f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                    UParseError    *pe,
197f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                    UErrorCode     *status);
198f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)#endif
199f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
200f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
201f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
202f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
203f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  Close the regular expression, recovering all resources (memory) it
204f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   was holding.
205f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
206f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param regexp   The regular expression to be closed.
207f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @stable ICU 3.0
208f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
209f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE void U_EXPORT2
210f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_close(URegularExpression *regexp);
211f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
212f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)#if U_SHOW_CPLUSPLUS_API
213f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
214f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_NAMESPACE_BEGIN
215f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
216f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
217f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * \class LocalURegularExpressionPointer
218f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * "Smart pointer" class, closes a URegularExpression via uregex_close().
219f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * For most methods see the LocalPointerBase base class.
220f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
221f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @see LocalPointerBase
222f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @see LocalPointer
223f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @stable ICU 4.4
224f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) */
225f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DEFINE_LOCAL_OPEN_POINTER(LocalURegularExpressionPointer, URegularExpression, uregex_close);
226f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
227f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_NAMESPACE_END
228f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
229f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)#endif
230f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
231f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
232f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * Make a copy of a compiled regular expression.  Cloning a regular
233f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * expression is faster than opening a second instance from the source
234f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * form of the expression, and requires less memory.
235f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * <p>
236f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * Note that the current input string and the position of any matched text
237f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *  within it are not cloned; only the pattern itself and and the
238f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *  match mode flags are copied.
239f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * <p>
240f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * Cloning can be particularly useful to threaded applications that perform
241f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * multiple match operations in parallel.  Each concurrent RE
242f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * operation requires its own instance of a URegularExpression.
243f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
244f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param regexp   The compiled regular expression to be cloned.
245f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param status   Receives indication of any errors encountered
246f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @return the cloned copy of the compiled regular expression.
247f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @stable ICU 3.0
248f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) */
249f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE URegularExpression * U_EXPORT2
250f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_clone(const URegularExpression *regexp, UErrorCode *status);
251f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
252f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
253f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *  Returns a pointer to the source form of the pattern for this regular expression.
254f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *  This function will work even if the pattern was originally specified as a UText.
255f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
256f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param regexp     The compiled regular expression.
257f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param patLength  This output parameter will be set to the length of the
258f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                   pattern string.  A NULL pointer may be used here if the
259f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                   pattern length is not needed, as would be the case if
260f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                   the pattern is known in advance to be a NUL terminated
261f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                   string.
262f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param status     Receives errors detected by this function.
263f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @return a pointer to the pattern string.  The storage for the string is
264f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                   owned by the regular expression object, and must not be
265f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                   altered or deleted by the application.  The returned string
266f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                   will remain valid until the regular expression is closed.
267f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @stable ICU 3.0
268f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) */
269f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE const UChar * U_EXPORT2
270f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_pattern(const URegularExpression *regexp,
271f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                     int32_t            *patLength,
272f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                     UErrorCode         *status);
273f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
274f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
275f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *  Returns the source text of the pattern for this regular expression.
276f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *  This function will work even if the pattern was originally specified as a UChar string.
277f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
278f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param regexp     The compiled regular expression.
279f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param status     Receives errors detected by this function.
280f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @return the pattern text.  The storage for the text is owned by the regular expression
281f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                   object, and must not be altered or deleted.
282f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
283f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @draft ICU 4.6
284f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) */
285f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT UText * U_EXPORT2
286f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_patternUText(const URegularExpression *regexp,
287f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                          UErrorCode         *status);
288f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
289f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
290f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
291f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Get the match mode flags that were specified when compiling this regular expression.
292f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param status   Receives errors detected by this function.
293f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param regexp   The compiled regular expression.
294f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @return         The match mode flags
295f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @see URegexpFlag
296f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @stable ICU 3.0
297f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
298f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE int32_t U_EXPORT2
299f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_flags(const  URegularExpression   *regexp,
300f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                    UErrorCode           *status);
301f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
302f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
303f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
304f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  Set the subject text string upon which the regular expression will look for matches.
305f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  This function may be called any number of times, allowing the regular
306f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  expression pattern to be applied to different strings.
307f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  <p>
308f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  Regular expression matching operations work directly on the application's
309f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  string data.  No copy is made.  The subject string data must not be
310f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  altered after calling this function until after all regular expression
311f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  operations involving this string data are completed.
312f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  <p>
313f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  Zero length strings are permitted.  In this case, no subsequent match
314f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  operation will dereference the text string pointer.
315f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
316f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param regexp     The compiled regular expression.
317f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param text       The subject text string.
318f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param textLength The length of the subject text, or -1 if the string
319f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                   is NUL terminated.
320f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param status     Receives errors detected by this function.
321f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @stable ICU 3.0
322f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
323f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE void U_EXPORT2
324f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_setText(URegularExpression *regexp,
325f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)               const UChar        *text,
326f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)               int32_t             textLength,
327f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)               UErrorCode         *status);
328f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
329f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
330f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
331f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  Set the subject text string upon which the regular expression will look for matches.
332f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  This function may be called any number of times, allowing the regular
333f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  expression pattern to be applied to different strings.
334f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  <p>
335f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  Regular expression matching operations work directly on the application's
336f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  string data; only a shallow clone is made.  The subject string data must not be
337f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  altered after calling this function until after all regular expression
338f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  operations involving this string data are completed.
339f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
340f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param regexp     The compiled regular expression.
341f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param text       The subject text string.
342f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param status     Receives errors detected by this function.
343f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
344f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @draft ICU 4.6
345f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
346f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT void U_EXPORT2
347f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_setUText(URegularExpression *regexp,
348f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                UText              *text,
349f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                UErrorCode         *status);
350f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
351f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
352f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  Get the subject text that is currently associated with this
353f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   regular expression object.  If the input was supplied using uregex_setText(),
354f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   that pointer will be returned.  Otherwise, the characters in the input will
355f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   be extracted to a buffer and returned.  In either case, ownership remains
356f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   with the regular expression object.
357f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
358f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  This function will work even if the input was originally specified as a UText.
359f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
360f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param regexp      The compiled regular expression.
361f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param textLength  The length of the string is returned in this output parameter.
362f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                    A NULL pointer may be used here if the
363f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                    text length is not needed, as would be the case if
364f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                    the text is known in advance to be a NUL terminated
365f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                    string.
366f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param status      Receives errors detected by this function.
367f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @return            Pointer to the subject text string currently associated with
368f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                    this regular expression.
369f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @stable ICU 3.0
370f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
371f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE const UChar * U_EXPORT2
372f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_getText(URegularExpression *regexp,
373f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)               int32_t            *textLength,
374f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)               UErrorCode         *status);
375f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
376f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
377f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
378f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  Get the subject text that is currently associated with this
379f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   regular expression object.
380f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
381f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  This function will work even if the input was originally specified as a UChar string.
382f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
383f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param regexp      The compiled regular expression.
384f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param dest        A mutable UText in which to store the current input.
385f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                    If NULL, a new UText will be created as an immutable shallow clone
386f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                    of the actual input string.
387f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param status      Receives errors detected by this function.
388f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @return            The subject text currently associated with this regular expression.
389f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                    If a pre-allocated UText was provided, it will always be used and returned.
390f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
391f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @draft ICU 4.6
392f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
393f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT UText * U_EXPORT2
394f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_getUText(URegularExpression *regexp,
395f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                UText              *dest,
396f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                UErrorCode         *status);
397f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
398f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
399f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   Attempts to match the input string against the pattern.
400f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   To succeed, the match must extend to the end of the string,
401f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   or cover the complete match region.
402f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
403f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   If startIndex >= zero the match operation starts at the specified
404f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   index and must extend to the end of the input string.  Any region
405f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   that has been specified is reset.
406f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
407f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   If startIndex == -1 the match must cover the input region, or the entire
408f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   input string if no region has been set.  This directly corresponds to
409f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   Matcher.matches() in Java
410f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
411f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param  regexp      The compiled regular expression.
412f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param  startIndex  The input string (native) index at which to begin matching, or -1
413f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        to match the input Region.
414f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param  status      Receives errors detected by this function.
415f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @return             TRUE if there is a match
416f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @stable ICU 3.0
417f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
418f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE UBool U_EXPORT2
419f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_matches(URegularExpression *regexp,
420f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                int32_t            startIndex,
421f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                UErrorCode        *status);
422f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
423f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
424f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   64bit version of uregex_matches.
425f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @draft ICU 4.6
426f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
427f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT UBool U_EXPORT2
428f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_matches64(URegularExpression *regexp,
429f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                 int64_t            startIndex,
430f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                 UErrorCode        *status);
431f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
432f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
433f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   Attempts to match the input string, starting from the specified index, against the pattern.
434f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   The match may be of any length, and is not required to extend to the end
435f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   of the input string.  Contrast with uregex_matches().
436f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
437f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   <p>If startIndex is >= 0 any input region that was set for this
438f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   URegularExpression is reset before the operation begins.
439f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
440f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   <p>If the specified starting index == -1 the match begins at the start of the input
441f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   region, or at the start of the full string if no region has been specified.
442f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   This corresponds directly with Matcher.lookingAt() in Java.
443f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
444f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   <p>If the match succeeds then more information can be obtained via the
445f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    <code>uregexp_start()</code>, <code>uregexp_end()</code>,
446f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    and <code>uregexp_group()</code> functions.</p>
447f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
448f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   regexp      The compiled regular expression.
449f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   startIndex  The input string (native) index at which to begin matching, or
450f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                         -1 to match the Input Region
451f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   status      A reference to a UErrorCode to receive any errors.
452f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @return  TRUE if there is a match.
453f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @stable ICU 3.0
454f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
455f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE UBool U_EXPORT2
456f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_lookingAt(URegularExpression *regexp,
457f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                 int32_t             startIndex,
458f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                 UErrorCode         *status);
459f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
460f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
461f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   64bit version of uregex_lookingAt.
462f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @draft ICU 4.6
463f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
464f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT UBool U_EXPORT2
465f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_lookingAt64(URegularExpression *regexp,
466f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                   int64_t             startIndex,
467f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                   UErrorCode         *status);
468f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
469f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
470f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   Find the first matching substring of the input string that matches the pattern.
471f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   If startIndex is >= zero the search for a match begins at the specified index,
472f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *          and any match region is reset.  This corresponds directly with
473f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *          Matcher.find(startIndex) in Java.
474f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
475f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   If startIndex == -1 the search begins at the start of the input region,
476f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *           or at the start of the full string if no region has been specified.
477f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
478f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   If a match is found, <code>uregex_start(), uregex_end()</code>, and
479f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   <code>uregex_group()</code> will provide more information regarding the match.
480f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
481f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   regexp      The compiled regular expression.
482f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   startIndex  The position (native) in the input string to begin the search, or
483f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        -1 to search within the Input Region.
484f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   status      A reference to a UErrorCode to receive any errors.
485f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @return              TRUE if a match is found.
486f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @stable ICU 3.0
487f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
488f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE UBool U_EXPORT2
489f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_find(URegularExpression *regexp,
490f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)            int32_t             startIndex,
491f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)            UErrorCode         *status);
492f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
493f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
494f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   64bit version of uregex_find.
495f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @draft ICU 4.6
496f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
497f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT UBool U_EXPORT2
498f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_find64(URegularExpression *regexp,
499f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)              int64_t             startIndex,
500f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)              UErrorCode         *status);
501f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
502f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
503f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  Find the next pattern match in the input string.  Begin searching
504f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  the input at the location following the end of he previous match,
505f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  or at the start of the string (or region) if there is no
506f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  previous match.  If a match is found, <code>uregex_start(), uregex_end()</code>, and
507f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  <code>uregex_group()</code> will provide more information regarding the match.
508f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
509f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  @param   regexp      The compiled regular expression.
510f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  @param   status      A reference to a UErrorCode to receive any errors.
511f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  @return              TRUE if a match is found.
512f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  @see uregex_reset
513f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  @stable ICU 3.0
514f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
515f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE UBool U_EXPORT2
516f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_findNext(URegularExpression *regexp,
517f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                UErrorCode         *status);
518f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
519f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
520f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   Get the number of capturing groups in this regular expression's pattern.
521f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   regexp      The compiled regular expression.
522f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   status      A reference to a UErrorCode to receive any errors.
523f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @return the number of capture groups
524f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @stable ICU 3.0
525f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
526f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE int32_t U_EXPORT2
527f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_groupCount(URegularExpression *regexp,
528f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  UErrorCode         *status);
529f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
530f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/** Extract the string for the specified matching expression or subexpression.
531f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Group #0 is the complete string of matched text.
532f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Group #1 is the text matched by the first set of capturing parentheses.
533f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
534f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   regexp       The compiled regular expression.
535f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   groupNum     The capture group to extract.  Group 0 is the complete
536f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                         match.  The value of this parameter must be
537f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                         less than or equal to the number of capture groups in
538f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                         the pattern.
539f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   dest         Buffer to receive the matching string data
540f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   destCapacity Capacity of the dest buffer.
541f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   status       A reference to a UErrorCode to receive any errors.
542f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @return               Length of matching data,
543f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                         or -1 if no applicable match.
544f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @stable ICU 3.0
545f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
546f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE int32_t U_EXPORT2
547f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_group(URegularExpression *regexp,
548f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)             int32_t             groupNum,
549f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)             UChar              *dest,
550f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)             int32_t             destCapacity,
551f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)             UErrorCode          *status);
552f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
553f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
554f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/** Returns a shallow immutable clone of the entire input string.  The returned UText current native index
555f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   is set to the beginning of the requested capture group.  The capture group length is also
556f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   returned via groupLength.
557f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Group #0 is the complete string of matched text.
558f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Group #1 is the text matched by the first set of capturing parentheses.
559f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
560f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   regexp       The compiled regular expression.
561f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   groupNum     The capture group to extract.  Group 0 is the complete
562f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                         match.  The value of this parameter must be
563f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                         less than or equal to the number of capture groups in
564f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                         the pattern.
565f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   dest         A mutable UText in which to store the current input.
566f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                         If NULL, a new UText will be created as an immutable shallow clone
567f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                         of the entire input string.
568f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   groupLength  The group length of the desired capture group.
569f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   status       A reference to a UErrorCode to receive any errors.
570f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @return               The subject text currently associated with this regular expression.
571f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                         If a pre-allocated UText was provided, it will always be used and returned.
572f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
573f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
574f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @draft ICU 4.6
575f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
576f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT UText * U_EXPORT2
577f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_groupUText(URegularExpression *regexp,
578f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  int32_t             groupNum,
579f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  UText              *dest,
580f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  int64_t            *groupLength,
581f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  UErrorCode         *status);
582f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
583f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
584f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/** Extract the string for the specified matching expression or subexpression.
585f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Group #0 is the complete string of matched text.
586f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Group #1 is the text matched by the first set of capturing parentheses.
587f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
588f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   regexp       The compiled regular expression.
589f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   groupNum     The capture group to extract.  Group 0 is the complete
590f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                         match.  The value of this parameter must be
591f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                         less than or equal to the number of capture groups in
592f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                         the pattern.
593f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   dest         Mutable UText to receive the matching string data.
594f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                         If NULL, a new UText will be created (which may not be mutable).
595f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   status       A reference to a UErrorCode to receive any errors.
596f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @return               The matching string data. If a pre-allocated UText was provided,
597f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                          it will always be used and returned.
598f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
599f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @internal ICU 4.4 technology preview
600f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
601f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_INTERNAL UText * U_EXPORT2
602f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_groupUTextDeep(URegularExpression *regexp,
603f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  int32_t             groupNum,
604f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  UText              *dest,
605f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  UErrorCode         *status);
606f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
607f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
608f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   Returns the index in the input string of the start of the text matched by the
609f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   specified capture group during the previous match operation.  Return -1 if
610f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   the capture group was not part of the last match.
611f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   Group #0 refers to the complete range of matched text.
612f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   Group #1 refers to the text matched by the first set of capturing parentheses.
613f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
614f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   regexp      The compiled regular expression.
615f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   groupNum    The capture group number
616f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   status      A reference to a UErrorCode to receive any errors.
617f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @return              the starting (native) position in the input of the text matched
618f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                         by the specified group.
619f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @stable ICU 3.0
620f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
621f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE int32_t U_EXPORT2
622f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_start(URegularExpression *regexp,
623f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)             int32_t             groupNum,
624f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)             UErrorCode          *status);
625f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
626f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
627f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   64bit version of uregex_start.
628f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @draft ICU 4.6
629f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
630f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT int64_t U_EXPORT2
631f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_start64(URegularExpression *regexp,
632f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)               int32_t             groupNum,
633f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)               UErrorCode          *status);
634f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
635f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
636f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   Returns the index in the input string of the position following the end
637f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   of the text matched by the specified capture group.
638f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   Return -1 if the capture group was not part of the last match.
639f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   Group #0 refers to the complete range of matched text.
640f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   Group #1 refers to the text matched by the first set of capturing parentheses.
641f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
642f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   regexp      The compiled regular expression.
643f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   groupNum    The capture group number
644f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   status      A reference to a UErrorCode to receive any errors.
645f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @return              the (native) index of the position following the last matched character.
646f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @stable ICU 3.0
647f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
648f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE int32_t U_EXPORT2
649f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_end(URegularExpression   *regexp,
650f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)           int32_t               groupNum,
651f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)           UErrorCode           *status);
652f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
653f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
654f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   64bit version of uregex_end.
655f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @draft ICU 4.6
656f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
657f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT int64_t U_EXPORT2
658f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_end64(URegularExpression *regexp,
659f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)             int32_t               groupNum,
660f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)             UErrorCode           *status);
661f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
662f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
663f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  Reset any saved state from the previous match.  Has the effect of
664f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  causing uregex_findNext to begin at the specified index, and causing
665f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  uregex_start(), uregex_end() and uregex_group() to return an error
666f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  indicating that there is no match information available.  Clears any
667f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  match region that may have been set.
668f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
669f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   regexp      The compiled regular expression.
670f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   index       The position (native) in the text at which a
671f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                         uregex_findNext() should begin searching.
672f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   status      A reference to a UErrorCode to receive any errors.
673f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @stable ICU 3.0
674f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
675f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE void U_EXPORT2
676f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_reset(URegularExpression    *regexp,
677f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)             int32_t               index,
678f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)             UErrorCode            *status);
679f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
680f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
681f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   64bit version of uregex_reset.
682f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @draft ICU 4.6
683f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
684f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT void U_EXPORT2
685f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_reset64(URegularExpression  *regexp,
686f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)               int64_t               index,
687f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)               UErrorCode            *status);
688f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
689f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/** Sets the limits of the matching region for this URegularExpression.
690f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * The region is the part of the input string that will be considered when matching.
691f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Invoking this method resets any saved state from the previous match,
692f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * then sets the region to start at the index specified by the start parameter
693f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * and end at the index specified by the end parameter.
694f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
695f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Depending on the transparency and anchoring being used (see useTransparentBounds
696f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * and useAnchoringBounds), certain constructs such as anchors may behave differently
697f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * at or around the boundaries of the region
698f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
699f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * The function will fail if start is greater than limit, or if either index
700f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  is less than zero or greater than the length of the string being matched.
701f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
702f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param regexp The compiled regular expression.
703f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param regionStart  The (native) index to begin searches at.
704f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param regionLimit  The (native) index to end searches at (exclusive).
705f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param status A pointer to a UErrorCode to receive any errors.
706f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @stable ICU 4.0
707f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
708f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE void U_EXPORT2
709f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_setRegion(URegularExpression   *regexp,
710f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                 int32_t               regionStart,
711f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                 int32_t               regionLimit,
712f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                 UErrorCode           *status);
713f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
714f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
715f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   64bit version of uregex_setRegion.
716f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @draft ICU 4.6
717f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
718f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT void U_EXPORT2
719f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_setRegion64(URegularExpression *regexp,
720f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                 int64_t               regionStart,
721f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                 int64_t               regionLimit,
722f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                 UErrorCode           *status);
723f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
724f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
725f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   Variation on uregex_setRegion to set the region without resetting the start index
726f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *     without resetting the position for subsequent matches.
727f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @draft ICU 4.6
728f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
729f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT void U_EXPORT2
730f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_setRegionAndStart(URegularExpression *regexp,
731f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                 int64_t               regionStart,
732f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                 int64_t               regionLimit,
733f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                 int64_t               startIndex,
734f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                 UErrorCode           *status);
735f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
736f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
737f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Reports the start index of the matching region. Any matches found are limited to
738f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * to the region bounded by regionStart (inclusive) and regionEnd (exclusive).
739f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
740f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param regexp The compiled regular expression.
741f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param status A pointer to a UErrorCode to receive any errors.
742f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @return The starting (native) index of this matcher's region.
743f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @stable ICU 4.0
744f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
745f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE int32_t U_EXPORT2
746f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_regionStart(const  URegularExpression   *regexp,
747f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                          UErrorCode           *status);
748f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
749f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
750f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   64bit version of uregex_regionStart.
751f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @draft ICU 4.6
752f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
753f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT int64_t U_EXPORT2
754f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_regionStart64(const  URegularExpression   *regexp,
755f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                            UErrorCode           *status);
756f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
757f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
758f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Reports the end index (exclusive) of the matching region for this URegularExpression.
759f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Any matches found are limited to to the region bounded by regionStart (inclusive)
760f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * and regionEnd (exclusive).
761f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
762f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param regexp The compiled regular expression.
763f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param status A pointer to a UErrorCode to receive any errors.
764f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @return The ending point (native) of this matcher's region.
765f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @stable ICU 4.0
766f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
767f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE int32_t U_EXPORT2
768f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_regionEnd(const  URegularExpression   *regexp,
769f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                        UErrorCode           *status);
770f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
771f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
772f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   64bit version of uregex_regionEnd.
773f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @draft ICU 4.6
774f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
775f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT int64_t U_EXPORT2
776f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_regionEnd64(const  URegularExpression   *regexp,
777f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                          UErrorCode           *status);
778f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
779f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
780f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Queries the transparency of region bounds for this URegularExpression.
781f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * See useTransparentBounds for a description of transparent and opaque bounds.
782f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * By default, matching boundaries are opaque.
783f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
784f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param regexp The compiled regular expression.
785f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param status A pointer to a UErrorCode to receive any errors.
786f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @return TRUE if this matcher is using opaque bounds, false if it is not.
787f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @stable ICU 4.0
788f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
789f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE UBool U_EXPORT2
790f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_hasTransparentBounds(const  URegularExpression   *regexp,
791f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                                   UErrorCode           *status);
792f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
793f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
794f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
795f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Sets the transparency of region bounds for this URegularExpression.
796f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Invoking this function with an argument of TRUE will set matches to use transparent bounds.
797f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * If the boolean argument is FALSE, then opaque bounds will be used.
798f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
799f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Using transparent bounds, the boundaries of the matching region are transparent
800f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * to lookahead, lookbehind, and boundary matching constructs. Those constructs can
801f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * see text beyond the boundaries of the region while checking for a match.
802f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
803f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * With opaque bounds, no text outside of the matching region is visible to lookahead,
804f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * lookbehind, and boundary matching constructs.
805f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
806f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * By default, opaque bounds are used.
807f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
808f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param   regexp The compiled regular expression.
809f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param   b      TRUE for transparent bounds; FALSE for opaque bounds
810f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param   status A pointer to a UErrorCode to receive any errors.
811f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @stable ICU 4.0
812f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  **/
813f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE void U_EXPORT2
814f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_useTransparentBounds(URegularExpression   *regexp,
815f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                            UBool                b,
816f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                            UErrorCode           *status);
817f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
818f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
819f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
820f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Return true if this URegularExpression is using anchoring bounds.
821f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * By default, anchoring region bounds are used.
822f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
823f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param  regexp The compiled regular expression.
824f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param  status A pointer to a UErrorCode to receive any errors.
825f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @return TRUE if this matcher is using anchoring bounds.
826f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @stable ICU 4.0
827f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
828f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE UBool U_EXPORT2
829f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_hasAnchoringBounds(const  URegularExpression   *regexp,
830f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                                 UErrorCode           *status);
831f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
832f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
833f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
834f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Set whether this URegularExpression is using Anchoring Bounds for its region.
835f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * With anchoring bounds, pattern anchors such as ^ and $ will match at the start
836f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * and end of the region.  Without Anchoring Bounds, anchors will only match at
837f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * the positions they would in the complete text.
838f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
839f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Anchoring Bounds are the default for regions.
840f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
841f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param regexp The compiled regular expression.
842f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param b      TRUE if to enable anchoring bounds; FALSE to disable them.
843f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param status A pointer to a UErrorCode to receive any errors.
844f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @stable ICU 4.0
845f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
846f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE void U_EXPORT2
847f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_useAnchoringBounds(URegularExpression   *regexp,
848f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                          UBool                 b,
849f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                          UErrorCode           *status);
850f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
851f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
852f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Return TRUE if the most recent matching operation touched the
853f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  end of the text being processed.  In this case, additional input text could
854f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  change the results of that match.
855f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
856f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  @param regexp The compiled regular expression.
857f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  @param status A pointer to a UErrorCode to receive any errors.
858f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  @return  TRUE if the most recent match hit the end of input
859f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  @stable ICU 4.0
860f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
861f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE UBool U_EXPORT2
862f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_hitEnd(const  URegularExpression   *regexp,
863f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                     UErrorCode           *status);
864f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
865f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
866f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * Return TRUE the most recent match succeeded and additional input could cause
867f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * it to fail. If this function returns false and a match was found, then more input
868f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * might change the match but the match won't be lost. If a match was not found,
869f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * then requireEnd has no meaning.
870f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
871f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param regexp The compiled regular expression.
872f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @param status A pointer to a UErrorCode to receive any errors.
873f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @return TRUE  if more input could cause the most recent match to no longer match.
874f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * @stable ICU 4.0
875f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
876f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE UBool U_EXPORT2
877f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_requireEnd(const  URegularExpression   *regexp,
878f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                         UErrorCode           *status);
879f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
880f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
881f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
882f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
883f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
884f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
885f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    Replaces every substring of the input that matches the pattern
886f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    with the given replacement string.  This is a convenience function that
887f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    provides a complete find-and-replace-all operation.
888f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
889f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    This method scans the input string looking for matches of the pattern.
890f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    Input that is not part of any match is copied unchanged to the
891f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    destination buffer.  Matched regions are replaced in the output
892f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    buffer by the replacement string.   The replacement string may contain
893f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    references to capture groups; these take the form of $1, $2, etc.
894f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
895f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   regexp             The compiled regular expression.
896f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   replacementText    A string containing the replacement text.
897f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   replacementLength  The length of the replacement string, or
898f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                                -1 if it is NUL terminated.
899f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   destBuf            A (UChar *) buffer that will receive the result.
900f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   destCapacity       The capacity of the desitnation buffer.
901f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   status             A reference to a UErrorCode to receive any errors.
902f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @return                     The length of the string resulting from the find
903f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                                and replace operation.  In the event that the
904f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                                destination capacity is inadequate, the return value
905f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                                is still the full length of the untruncated string.
906f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @stable ICU 3.0
907f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
908f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE int32_t U_EXPORT2
909f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_replaceAll(URegularExpression    *regexp,
910f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  const UChar           *replacementText,
911f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  int32_t                replacementLength,
912f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  UChar                 *destBuf,
913f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  int32_t                destCapacity,
914f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  UErrorCode            *status);
915f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
916f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
917f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    Replaces every substring of the input that matches the pattern
918f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    with the given replacement string.  This is a convenience function that
919f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    provides a complete find-and-replace-all operation.
920f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
921f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    This method scans the input string looking for matches of the pattern.
922f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    Input that is not part of any match is copied unchanged to the
923f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    destination buffer.  Matched regions are replaced in the output
924f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    buffer by the replacement string.   The replacement string may contain
925f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    references to capture groups; these take the form of $1, $2, etc.
926f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
927f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   regexp         The compiled regular expression.
928f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   replacement    A string containing the replacement text.
929f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   dest           A mutable UText that will receive the result.
930f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                             If NULL, a new UText will be created (which may not be mutable).
931f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   status         A reference to a UErrorCode to receive any errors.
932f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @return                 A UText containing the results of the find and replace.
933f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                             If a pre-allocated UText was provided, it will always be used and returned.
934f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
935f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @draft ICU 4.6
936f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
937f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT UText * U_EXPORT2
938f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_replaceAllUText(URegularExpression *regexp,
939f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                       UText              *replacement,
940f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                       UText              *dest,
941f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                       UErrorCode         *status);
942f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
943f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
944f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    Replaces the first substring of the input that matches the pattern
945f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    with the given replacement string.  This is a convenience function that
946f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    provides a complete find-and-replace operation.
947f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
948f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    This method scans the input string looking for a match of the pattern.
949f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    All input that is not part of the match is copied unchanged to the
950f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    destination buffer.  The matched region is replaced in the output
951f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    buffer by the replacement string.   The replacement string may contain
952f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    references to capture groups; these take the form of $1, $2, etc.
953f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
954f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   regexp             The compiled regular expression.
955f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   replacementText    A string containing the replacement text.
956f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   replacementLength  The length of the replacement string, or
957f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                                -1 if it is NUL terminated.
958f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   destBuf            A (UChar *) buffer that will receive the result.
959f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   destCapacity       The capacity of the desitnation buffer.
960f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   status             a reference to a UErrorCode to receive any errors.
961f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @return                     The length of the string resulting from the find
962f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                                and replace operation.  In the event that the
963f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                                destination capacity is inadequate, the return value
964f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                                is still the full length of the untruncated string.
965f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @stable ICU 3.0
966f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
967f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE int32_t U_EXPORT2
968f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_replaceFirst(URegularExpression  *regexp,
969f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                    const UChar         *replacementText,
970f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                    int32_t              replacementLength,
971f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                    UChar               *destBuf,
972f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                    int32_t              destCapacity,
973f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                    UErrorCode          *status);
974f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
975f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
976f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    Replaces the first substring of the input that matches the pattern
977f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    with the given replacement string.  This is a convenience function that
978f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    provides a complete find-and-replace operation.
979f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
980f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    This method scans the input string looking for a match of the pattern.
981f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    All input that is not part of the match is copied unchanged to the
982f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    destination buffer.  The matched region is replaced in the output
983f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    buffer by the replacement string.   The replacement string may contain
984f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    references to capture groups; these take the form of $1, $2, etc.
985f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
986f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   regexp         The compiled regular expression.
987f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   replacement    A string containing the replacement text.
988f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   dest           A mutable UText that will receive the result.
989f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                             If NULL, a new UText will be created (which may not be mutable).
990f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @param   status         A reference to a UErrorCode to receive any errors.
991f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @return                 A UText containing the results of the find and replace.
992f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                             If a pre-allocated UText was provided, it will always be used and returned.
993f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
994f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *    @draft ICU 4.6
995f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
996f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT UText * U_EXPORT2
997f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_replaceFirstUText(URegularExpression *regexp,
998f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                         UText              *replacement,
999f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                         UText              *dest,
1000f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                         UErrorCode         *status);
1001f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1002f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1003f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
1004f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   Implements a replace operation intended to be used as part of an
1005f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   incremental find-and-replace.
1006f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
1007f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   <p>The input string, starting from the end of the previous match and ending at
1008f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   the start of the current match, is appended to the destination string.  Then the
1009f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   replacement string is appended to the output string,
1010f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   including handling any substitutions of captured text.</p>
1011f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
1012f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   <p>A note on preflight computation of buffersize and error handling:
1013f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   Calls to uregex_appendReplacement() and uregex_appendTail() are
1014f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   designed to be chained, one after another, with the destination
1015f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   buffer pointer and buffer capacity updated after each in preparation
1016f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   to for the next.  If the destination buffer is exhausted partway through such a
1017f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   sequence, a U_BUFFER_OVERFLOW_ERROR status will be returned.  Normal
1018f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   ICU conventions are for a function to perform no action if it is
1019f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   called with an error status, but for this one case, uregex_appendRepacement()
1020f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   will operate normally so that buffer size computations will complete
1021f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   correctly.
1022f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
1023f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   <p>For simple, prepackaged, non-incremental find-and-replace
1024f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *      operations, see replaceFirst() or replaceAll().</p>
1025f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
1026f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   regexp      The regular expression object.
1027f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   replacementText The string that will replace the matched portion of the
1028f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        input string as it is copied to the destination buffer.
1029f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        The replacement text may contain references ($1, for
1030f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        example) to capture groups from the match.
1031f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   replacementLength  The length of the replacement text string,
1032f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        or -1 if the string is NUL terminated.
1033f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   destBuf     The buffer into which the results of the
1034f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        find-and-replace are placed.  On return, this pointer
1035f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        will be updated to refer to the beginning of the
1036f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        unused portion of buffer, leaving it in position for
1037f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        a subsequent call to this function.
1038f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   destCapacity The size of the output buffer,  On return, this
1039f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        parameter will be updated to reflect the space remaining
1040f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        unused in the output buffer.
1041f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   status      A reference to a UErrorCode to receive any errors.
1042f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @return              The length of the result string.  In the event that
1043f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        destCapacity is inadequate, the full length of the
1044f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        untruncated output string is returned.
1045f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
1046f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @stable ICU 3.0
1047f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
1048f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
1049f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE int32_t U_EXPORT2
1050f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_appendReplacement(URegularExpression    *regexp,
1051f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                         const UChar           *replacementText,
1052f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                         int32_t                replacementLength,
1053f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                         UChar                **destBuf,
1054f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                         int32_t               *destCapacity,
1055f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                         UErrorCode            *status);
1056f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1057f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1058f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
1059f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   Implements a replace operation intended to be used as part of an
1060f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   incremental find-and-replace.
1061f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
1062f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   <p>The input string, starting from the end of the previous match and ending at
1063f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   the start of the current match, is appended to the destination string.  Then the
1064f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   replacement string is appended to the output string,
1065f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   including handling any substitutions of captured text.</p>
1066f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
1067f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   <p>For simple, prepackaged, non-incremental find-and-replace
1068f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *      operations, see replaceFirst() or replaceAll().</p>
1069f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
1070f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   regexp      The regular expression object.
1071f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   replacementText The string that will replace the matched portion of the
1072f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        input string as it is copied to the destination buffer.
1073f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        The replacement text may contain references ($1, for
1074f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        example) to capture groups from the match.
1075f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   dest        A mutable UText that will receive the result. Must not be NULL.
1076f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   status      A reference to a UErrorCode to receive any errors.
1077f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
1078f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @draft ICU 4.6
1079f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
1080f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT void U_EXPORT2
1081f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_appendReplacementUText(URegularExpression    *regexp,
1082f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                              UText                 *replacementText,
1083f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                              UText                 *dest,
1084f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                              UErrorCode            *status);
1085f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1086f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1087f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
1088f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * As the final step in a find-and-replace operation, append the remainder
1089f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * of the input string, starting at the position following the last match,
1090f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * to the destination string. <code>uregex_appendTail()</code> is intended
1091f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  to be invoked after one or more invocations of the
1092f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  <code>uregex_appendReplacement()</code> function.
1093f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
1094f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   regexp      The regular expression object.  This is needed to
1095f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        obtain the input string and with the position
1096f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        of the last match within it.
1097f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   destBuf     The buffer in which the results of the
1098f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        find-and-replace are placed.  On return, the pointer
1099f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        will be updated to refer to the beginning of the
1100f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        unused portion of buffer.
1101f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   destCapacity The size of the output buffer,  On return, this
1102f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        value will be updated to reflect the space remaining
1103f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        unused in the output buffer.
1104f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   status      A reference to a UErrorCode to receive any errors.
1105f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @return              The length of the result string.  In the event that
1106f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        destCapacity is inadequate, the full length of the
1107f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        untruncated output string is returned.
1108f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
1109f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @stable ICU 3.0
1110f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
1111f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE int32_t U_EXPORT2
1112f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_appendTail(URegularExpression    *regexp,
1113f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  UChar                **destBuf,
1114f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  int32_t               *destCapacity,
1115f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  UErrorCode            *status);
1116f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1117f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1118f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
1119f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * As the final step in a find-and-replace operation, append the remainder
1120f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * of the input string, starting at the position following the last match,
1121f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  * to the destination string. <code>uregex_appendTailUText()</code> is intended
1122f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  to be invoked after one or more invocations of the
1123f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *  <code>uregex_appendReplacementUText()</code> function.
1124f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
1125f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   regexp      The regular expression object.  This is needed to
1126f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        obtain the input string and with the position
1127f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *                        of the last match within it.
1128f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @param   dest        A mutable UText that will receive the result. Must not be NULL.
1129f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @return              The destination UText.
1130f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *
1131f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  *   @draft ICU 4.6
1132f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  */
1133f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT UText * U_EXPORT2
1134f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_appendTailUText(URegularExpression    *regexp,
1135f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                       UText                 *dest,
1136f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                       UErrorCode            *status);
1137f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1138f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1139f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1140f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) /**
1141f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   * Split a string into fields.  Somewhat like split() from Perl.
1142f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *  The pattern matches identify delimiters that separate the input
1143f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *  into fields.  The input data between the matches becomes the
1144f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *  fields themselves.
1145f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   * <p>
1146f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *  Each of the fields is copied from the input string to the destination
1147f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *  buffer, and NUL terminated.  The position of each field within
1148f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *  the destination buffer is returned in the destFields array.
1149f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *
1150f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *  Note:  another choice for the design of this function would be to not
1151f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *         copy the resulting fields at all, but to return indexes and
1152f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *         lengths within the source text.
1153f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *           Advantages would be
1154f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *             o  Faster.  No Copying.
1155f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *             o  Nothing extra needed when field data may contain embedded NUL chars.
1156f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *             o  Less memory needed if working on large data.
1157f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *           Disadvantages
1158f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *             o  Less consistent with C++ split, which copies into an
1159f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                array of UnicodeStrings.
1160f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *             o  No NUL termination, extracted fields would be less convenient
1161f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                to use in most cases.
1162f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *             o  Possible problems in the future, when support Unicode Normalization
1163f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                could cause the fields to not correspond exactly to
1164f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                a range of the source text.
1165f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *
1166f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *    @param   regexp      The compiled regular expression.
1167f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *    @param   destBuf     A (UChar *) buffer to receive the fields that
1168f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                         are extracted from the input string. These
1169f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                         field pointers will refer to positions within the
1170f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                         destination buffer supplied by the caller.  Any
1171f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                         extra positions within the destFields array will be
1172f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                         set to NULL.
1173f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *    @param   destCapacity The capacity of the destBuf.
1174f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *    @param   requiredCapacity  The actual capacity required of the destBuf.
1175f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                         If destCapacity is too small, requiredCapacity will return
1176f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                         the total capacity required to hold all of the output, and
1177f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                         a U_BUFFER_OVERFLOW_ERROR will be returned.
1178f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *    @param   destFields  An array to be filled with the position of each
1179f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                         of the extracted fields within destBuf.
1180f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *    @param   destFieldsCapacity  The number of elements in the destFields array.
1181f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                If the number of fields found is less than destFieldsCapacity,
1182f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                the extra destFields elements are set to zero.
1183f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                If destFieldsCapacity is too small, the trailing part of the
1184f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                input, including any field delimiters, is treated as if it
1185f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                were the last field - it is copied to the destBuf, and
1186f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                its position is in the destBuf is stored in the last element
1187f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                of destFields.  This behavior mimics that of Perl.  It is not
1188f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                an error condition, and no error status is returned when all destField
1189f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                positions are used.
1190f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   * @param status  A reference to a UErrorCode to receive any errors.
1191f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   * @return        The number of fields into which the input string was split.
1192f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   * @stable ICU 3.0
1193f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   */
1194f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE int32_t U_EXPORT2
1195f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_split(   URegularExpression      *regexp,
1196f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  UChar                 *destBuf,
1197f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  int32_t                destCapacity,
1198f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  int32_t               *requiredCapacity,
1199f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  UChar                 *destFields[],
1200f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  int32_t                destFieldsCapacity,
1201f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  UErrorCode            *status);
1202f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1203f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1204f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)  /**
1205f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   * Split a string into fields.  Somewhat like split() from Perl.
1206f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   * The pattern matches identify delimiters that separate the input
1207f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *  into fields.  The input data between the matches becomes the
1208f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *  fields themselves.
1209f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   * <p>
1210f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   * The behavior of this function is not very closely aligned with uregex_split();
1211f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   * instead, it is based on (and implemented directly on top of) the C++ split method.
1212f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *
1213f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   * @param regexp  The compiled regular expression.
1214f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   * @param destFields    An array of mutable UText structs to receive the results of the split.
1215f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                If a field is NULL, a new UText is allocated to contain the results for
1216f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                that field. This new UText is not guaranteed to be mutable.
1217f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   * @param destFieldsCapacity  The number of elements in the destination array.
1218f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                If the number of fields found is less than destCapacity, the
1219f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                extra strings in the destination array are not altered.
1220f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                If the number of destination strings is less than the number
1221f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                of fields, the trailing part of the input string, including any
1222f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                field delimiters, is placed in the last destination string.
1223f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                This behavior mimics that of Perl.  It is not  an error condition, and no
1224f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *                error status is returned when all destField positions are used.
1225f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   * @param status  A reference to a UErrorCode to receive any errors.
1226f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   * @return        The number of fields into which the input string was split.
1227f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   *
1228f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   * @draft ICU 4.6
1229f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)   */
1230f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT int32_t U_EXPORT2
1231f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_splitUText(URegularExpression    *regexp,
1232f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  UText                 *destFields[],
1233f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  int32_t                destFieldsCapacity,
1234f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                  UErrorCode            *status);
1235f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1236f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1237f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1238f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1239f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
1240f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * Set a processing time limit for match operations with this URegularExpression.
1241f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
1242f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * Some patterns, when matching certain strings, can run in exponential time.
1243f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * For practical purposes, the match operation may appear to be in an
1244f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * infinite loop.
1245f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * When a limit is set a match operation will fail with an error if the
1246f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * limit is exceeded.
1247f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * <p>
1248f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * The units of the limit are steps of the match engine.
1249f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * Correspondence with actual processor time will depend on the speed
1250f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * of the processor and the details of the specific pattern, but will
1251f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * typically be on the order of milliseconds.
1252f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * <p>
1253f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * By default, the matching time is not limited.
1254f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * <p>
1255f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
1256f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   regexp      The compiled regular expression.
1257f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   limit       The limit value, or 0 for no limit.
1258f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   status      A reference to a UErrorCode to receive any errors.
1259f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @stable ICU 4.0
1260f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) */
1261f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE void U_EXPORT2
1262f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_setTimeLimit(URegularExpression      *regexp,
1263f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                    int32_t                  limit,
1264f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                    UErrorCode              *status);
1265f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1266f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
1267f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * Get the time limit for for matches with this URegularExpression.
1268f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * A return value of zero indicates that there is no limit.
1269f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
1270f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   regexp      The compiled regular expression.
1271f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   status      A reference to a UErrorCode to receive any errors.
1272f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @return the maximum allowed time for a match, in units of processing steps.
1273f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @stable ICU 4.0
1274f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) */
1275f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE int32_t U_EXPORT2
1276f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_getTimeLimit(const URegularExpression      *regexp,
1277f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                          UErrorCode              *status);
1278f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1279f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
1280f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * Set the amount of heap storage avaliable for use by the match backtracking stack.
1281f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * <p>
1282f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * ICU uses a backtracking regular expression engine, with the backtrack stack
1283f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * maintained on the heap.  This function sets the limit to the amount of memory
1284f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * that can be used  for this purpose.  A backtracking stack overflow will
1285f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * result in an error from the match operation that caused it.
1286f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * <p>
1287f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * A limit is desirable because a malicious or poorly designed pattern can use
1288f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * excessive memory, potentially crashing the process.  A limit is enabled
1289f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * by default.
1290f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * <p>
1291f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   regexp      The compiled regular expression.
1292f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   limit       The maximum size, in bytes, of the matching backtrack stack.
1293f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                      A value of -1 means no limit.
1294f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                      The limit must be greater than zero, or -1.
1295f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   status      A reference to a UErrorCode to receive any errors.
1296f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
1297f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @stable ICU 4.0
1298f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) */
1299f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE void U_EXPORT2
1300f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_setStackLimit(URegularExpression      *regexp,
1301f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                     int32_t                  limit,
1302f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                     UErrorCode              *status);
1303f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1304f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
1305f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * Get the size of the heap storage available for use by the back tracking stack.
1306f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
1307f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @return  the maximum backtracking stack size, in bytes, or zero if the
1308f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *          stack size is unlimited.
1309f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @stable ICU 4.0
1310f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) */
1311f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE int32_t U_EXPORT2
1312f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_getStackLimit(const URegularExpression      *regexp,
1313f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                           UErrorCode              *status);
1314f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1315f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1316f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
1317f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * Function pointer for a regular expression matching callback function.
1318f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * When set, a callback function will be called periodically during matching
1319f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * operations.  If the call back function returns FALSE, the matching
1320f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * operation will be terminated early.
1321f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
1322f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * Note:  the callback function must not call other functions on this
1323f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *        URegularExpression.
1324f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
1325f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param context  context pointer.  The callback function will be invoked
1326f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                 with the context specified at the time that
1327f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                 uregex_setMatchCallback() is called.
1328f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param steps    the accumulated processing time, in match steps,
1329f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                 for this matching operation.
1330f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @return         TRUE to continue the matching operation.
1331f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                 FALSE to terminate the matching operation.
1332f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @stable ICU 4.0
1333f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) */
1334f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_CDECL_BEGIN
1335f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)typedef UBool U_CALLCONV URegexMatchCallback (
1336f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                   const void *context,
1337f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                   int32_t     steps);
1338f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_CDECL_END
1339f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1340f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
1341f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * Set a callback function for this URegularExpression.
1342f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * During matching operations the function will be called periodically,
1343f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * giving the application the opportunity to terminate a long-running
1344f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * match.
1345f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
1346f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   regexp      The compiled regular expression.
1347f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   callback    A pointer to the user-supplied callback function.
1348f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   context     User context pointer.  The value supplied at the
1349f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                      time the callback function is set will be saved
1350f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                      and passed to the callback each time that it is called.
1351f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   status      A reference to a UErrorCode to receive any errors.
1352f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @stable ICU 4.0
1353f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) */
1354f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE void U_EXPORT2
1355f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_setMatchCallback(URegularExpression      *regexp,
1356f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                        URegexMatchCallback     *callback,
1357f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                        const void              *context,
1358f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                        UErrorCode              *status);
1359f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1360f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1361f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
1362f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *  Get the callback function for this URegularExpression.
1363f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
1364f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   regexp      The compiled regular expression.
1365f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   callback    Out paramater, receives a pointer to the user-supplied
1366f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                      callback function.
1367f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   context     Out parameter, receives the user context pointer that
1368f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                      was set when uregex_setMatchCallback() was called.
1369f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   status      A reference to a UErrorCode to receive any errors.
1370f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @stable ICU 4.0
1371f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) */
1372f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_STABLE void U_EXPORT2
1373f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_getMatchCallback(const URegularExpression    *regexp,
1374f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                        URegexMatchCallback        **callback,
1375f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                        const void                 **context,
1376f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                        UErrorCode                  *status);
1377f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1378f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1379f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
1380f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * Function pointer for a regular expression find callback function.
1381f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
1382f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * When set, a callback function will be called during a find operation
1383f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * and for operations that depend on find, such as findNext, split and some replace
1384f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * operations like replaceFirst.
1385f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * The callback will usually be called after each attempt at a match, but this is not a
1386f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * guarantee that the callback will be invoked at each character.  For finds where the
1387f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * match engine is invoked at each character, this may be close to true, but less likely
1388f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * for more optimized loops where the pattern is known to only start, and the match
1389f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * engine invoked, at certain characters.
1390f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * When invoked, this callback will specify the index at which a match operation is about
1391f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * to be attempted, giving the application the opportunity to terminate a long-running
1392f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * find operation.
1393f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
1394f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * If the call back function returns FALSE, the find operation will be terminated early.
1395f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
1396f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * Note:  the callback function must not call other functions on this
1397f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *        URegularExpression
1398f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
1399f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param context  context pointer.  The callback function will be invoked
1400f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                 with the context specified at the time that
1401f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                 uregex_setFindProgressCallback() is called.
1402f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param matchIndex  the next index at which a match attempt will be attempted for this
1403f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                 find operation.  If this callback interrupts the search, this is the
1404f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                 index at which a find/findNext operation may be re-initiated.
1405f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @return         TRUE to continue the matching operation.
1406f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                 FALSE to terminate the matching operation.
1407f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @draft ICU 4.6
1408f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) */
1409f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_CDECL_BEGIN
1410f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)typedef UBool U_CALLCONV URegexFindProgressCallback (
1411f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                   const void *context,
1412f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                   int64_t     matchIndex);
1413f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_CDECL_END
1414f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1415f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
1416f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *  Set the find progress callback function for this URegularExpression.
1417f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
1418f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   regexp      The compiled regular expression.
1419f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   callback    A pointer to the user-supplied callback function.
1420f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   context     User context pointer.  The value supplied at the
1421f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                      time the callback function is set will be saved
1422f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                      and passed to the callback each time that it is called.
1423f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   status      A reference to a UErrorCode to receive any errors.
1424f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @draft ICU 4.6
1425f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) */
1426f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT void U_EXPORT2
1427f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_setFindProgressCallback(URegularExpression              *regexp,
1428f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                                URegexFindProgressCallback      *callback,
1429f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                                const void                      *context,
1430f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                                UErrorCode                      *status);
1431f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1432f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1433f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)/**
1434f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *  Get the find progress callback function for this URegularExpression.
1435f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *
1436f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   regexp      The compiled regular expression.
1437f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   callback    Out paramater, receives a pointer to the user-supplied
1438f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                      callback function.
1439f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   context     Out parameter, receives the user context pointer that
1440f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) *                      was set when uregex_setFindProgressCallback() was called.
1441f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @param   status      A reference to a UErrorCode to receive any errors.
1442f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) * @draft ICU 4.6
1443f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles) */
1444f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)U_DRAFT void U_EXPORT2
1445f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)uregex_getFindProgressCallback(const URegularExpression          *regexp,
1446f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                                URegexFindProgressCallback        **callback,
1447f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                                const void                        **context,
1448f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)                                UErrorCode                        *status);
1449f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)
1450f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)#endif   /*  !UCONFIG_NO_REGULAR_EXPRESSIONS  */
1451f4ed1cf5d184064c4cf0e4359c6d5d8aadb50afaTorne (Richard Coles)#endif   /*  UREGEX_H  */
1452