Logo Search packages:      
Sourcecode: icu version File versions

U_STABLE URegularExpression* U_EXPORT2 uregex_openC ( const char *  pattern,
uint32_t  flags,
UParseError pe,
UErrorCode status 
)

Open (compile) an ICU regular expression. The resulting regular expression handle can then be used to perform various matching operations.

This function is the same as uregex_open, except that the pattern is supplied as an 8 bit char * string in the default code page.

Parameters:
pattern The Regular Expression pattern to be compiled, NUL termintated.
flags Flags that alter the default matching behavior for the regular expression, UREGEX_CASE_INSENSITIVE, for example. For default behavior, set this parameter to zero. See enum URegexpFlag. All desired flags are bitwise-ORed together.
pe Receives the position (line and column nubers) of any syntax error within the source regular expression string. If this information is not wanted, pass NULL for this parameter.
status Receives errors detected by this function.
Returns:
The URegularExpression object representing the compiled pattern.
ICU 3.0

Definition at line 25 of file uregexc.cpp.

References UnicodeString::getBuffer(), UnicodeString::length(), NULL, U_FAILURE, and U_ILLEGAL_ARGUMENT_ERROR.

                                            {
    if (U_FAILURE(*status)) {
        return NULL;
    }
    if (pattern == NULL) {
        *status = U_ILLEGAL_ARGUMENT_ERROR;
        return NULL;
    }

    UnicodeString patString(pattern);
    return uregex_open(patString.getBuffer(), patString.length(), flags, pe, status);
}


Generated by  Doxygen 1.6.0   Back to index