Sybernet / Supplied Functions Reference
Release 3.00
Oct 14, 2002
backwards forwards

HTTP.PATINDEX

This function returns an integer representing the starting position of the first occurrence of pattern in the specified character expression, zero if pattern is not found. The '%' wildcard character must precede and follow pattern, except when searching for first or last characters.

Syntax

FUNCTION PATINDEX
(
    PATTERN                       VARCHAR2
,   STRING                        VARCHAR2
)
RETURN NUMBER;

Parameters

Parameter Description
pattern
 
The pattern in string that you are searching for.
string
 
The string to be searched.

Returns

The one-relative position where this pattern was found or 0 if not found.

Matching Character Strings

You can include special symbols for matching character strings. The following table describes those symbols:

SymbolsMeaning
%Matches any string of zero or more characters
_Matches any one character
[specifier]Brackets enclose ranges or sets, such as [a-f] or [abcdef]. specifier may take two forms:

rangespec1 - rangespec2:

rangespec1 indicates the start of a range of characters.

- is a special character, indicating a range

rangespec2 indicates the end of a range of characters.
set:

can be comprised of any discrete set of values, in any order, such as [a2bR]. Note that the range [a-f], and the sets [abcdef] and [fcbdae] will return the same set of values.
[^specifier]caret (^) preceding a specifier indicates non-inclusion. [^a-f] means "not in the range a-f"; [^a2bR] means "not a, 2, b, or R."

Examples




Sybernet is a trademark of SRI International.
Copyright © 1996-2008 SRI International. All Rights Reserved.
Denis D. Workman / http://Sybernet.sri.com/