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

U_STABLE UBool U_EXPORT2 uregex_find ( URegularExpression regexp,
int32_t  startIndex,
UErrorCode status 
)

Find the first matching substring of the input string that matches the pattern. If startIndex is >= zero the search for a match begins at the specified index, and any match region is reset. This corresponds directly with Matcher.find(startIndex) in Java.

If startIndex == -1 the search begins at the start of the input region, or at the start of the full string if no region has been specified.

If a match is found, uregex_start(), uregex_end(), and uregex_group() will provide more information regarding the match.

Parameters:
regexp The compiled regular expression.
startIndex The position in the input string to begin the search, or -1 to search within the Input Region.
status A reference to a UErrorCode to receive any errors.
Returns:
TRUE if a match is found. ICU 3.0

Definition at line 540 of file uregex.cpp.

References FALSE.

                                         {
    RegularExpression *regexp = (RegularExpression*)regexp2;
    UBool result = FALSE;
    if (validateRE(regexp, status) == FALSE) {
        return result;
    }
    if (startIndex == -1) {
        regexp->fMatcher->resetPreserveRegion();
        result = regexp->fMatcher->find();
    } else {
        result = regexp->fMatcher->find(startIndex, *status);
    }
    return result;
}


Generated by  Doxygen 1.6.0   Back to index