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

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

Attempts to match the input string, starting from the specified index, against the pattern. The match may be of any length, and is not required to extend to the end of the input string. Contrast with uregex_matches().

If startIndex is >= 0 any input region that was set for this URegularExpression is reset before the operation begins.

If the specified starting index == -1 the match begins at the start of the input region, or at the start of the full string if no region has been specified. This corresponds directly with Matcher.lookingAt() in Java.

If the match succeeds then more information can be obtained via the uregexp_start(), uregexp_end(), and uregexp_group() functions.

Parameters:
regexp The compiled regular expression.
startIndex The input string index at which to begin matching, or -1 to match the Input Region
status A reference to a UErrorCode to receive any errors.
Returns:
TRUE if there is a match. ICU 3.0

Definition at line 516 of file uregex.cpp.

References FALSE.

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


Generated by  Doxygen 1.6.0   Back to index