Logo Search packages:      
Sourcecode: icu version File versions  Download package

U_INTERNAL int32_t U_EXPORT2 uregex_splitUText ( URegularExpression regexp,
UText destFields[],
int32_t  destFieldsCapacity,
UErrorCode status 

Split a string into fields. Somewhat like split() from Perl. The pattern matches identify delimiters that separate the input into fields. The input data between the matches becomes the fields themselves.

The behavior of this function is not very closely aligned with uregex_split(); instead, it is based on (and implemented directly on top of) the C++ split method.

regexp The compiled regular expression.
destFields An array of mutable UText structs to receive the results of the split. If a field is NULL, a new UText is allocated to contain the results for that field. This new UText is not guaranteed to be mutable.
destFieldsCapacity The number of elements in the destination array. If the number of fields found is less than destCapacity, the extra strings in the destination array are not altered. If the number of destination strings is less than the number of fields, the trailing part of the input string, including any field delimiters, is placed in the last destination string. This behavior mimics that of Perl. It is not an error condition, and no error status is returned when all destField positions are used.
status A reference to a UErrorCode to receive any errors.
The number of fields into which the input string was split.

For internal use only.

ICU 4.4 technology preview

Definition at line 1768 of file uregex.cpp.

    RegularExpression *regexp = (RegularExpression*)regexp2;
    return regexp->fMatcher->split(regexp->fMatcher->inputText(), destFields, destFieldsCapacity, *status);

Generated by  Doxygen 1.6.0   Back to index