The OWA_PATTERN operations all use the following three parameters:
MATCH ('BATMAN', 'Bat.*', i);This is how the function is interpreted: BATMAN is the target where we are searching for the regular expression. Bat.* is the regular expression we are attempting to find. The period (.) indicates any character other than newline, and the asterisk (*) indicates any 0 or more of such. Therefore, this regular expression specifies that a matching target consists of 'Bat', followed by any set of characters neither ending in nor including a newline (which does not match the period). The i at the end is a flag indicating that case is to be ignored in the search.
This would return TRUE, indicating that a match had been found.
Note that, if multiple overlapping strings can match the regular expression, OWA_PATTERN takes the longest match.
MATCH is a function that returns TRUE or FALSE depending on whether a match was found. Here is a summary of the versions of MATCH:
CHANGE('Cats in pajamas','C.+in', '& red ')The regular expression matches the substring 'Cats in'. It then replaces this string with '& red'. & indicates 'Cats in', since that's what matched the regular expression. Thus, this procedure replaces the string 'Cats in pajamas' with 'Cats in red pajamas'. Of course, we used a literal here for clarity. In actuality, 'Cats in pajamas' would be the value of a variable, and that value would be changed. Were this a function rather than a procedure, the value it would return would not be Cats in red pajamas' but 1, indicating that a single substitution had been made.
Go to the top of the section.
To report any problems or comments, e-mail Oracle WebServer Documentation.