WO03005288A2

Method and system for performing a pattern match search for text strings

Abstract

A method and system is disclosed for performing a pattern match search for a data string having a plurality of characters separated by delimiters. A search key is constructed by generating a full match search increment comprising the binary representation of a data string element, wherein the data string element comprises all characters between a pair of delimiters. The search key is completed by concatenating a pattern search prefix to the full match search increment, wherein the pattern search prefix is a cumulative pattern search result of each previous full match search increment. A full match search is then performed within a lookup table utilizing the search key. In response to finding a matching pattern within the lookup table, the process returns to constructing a next search key. In response to not finding a matching pattern, the previous full match search result is utilized to process the data string.

Term

No projected expiry on record.

  1. Priority
  2. Filed
  3. Published
  4. Today

11 claims: 7 independent, 4 dependent

  1. 1
    CLAIMS 1. A method for performing a pattern match search for a data string having a plurality of characters separated by delimiters, said method comprising:defining a first category of characters as delimiters such that all remaining characters are defined as non-delimiters;constructing a search key by: generating a full match search increment comprising the binary representation of a data string element, wherein said data string element comprises all non-delimiters between a pair of said delimiters;and concatenating a pattern search prefix to said full match search increment to form said search key, wherein said pattern search prefix is a cumulative pattern search result of each previous full match search increment;performing a full match search within a lookup table utilizing said search key;in response to finding a matching pattern within said lookup table, returning to said step of constructing a search key;and in response to not finding a matching pattern, utilizing the previous full match search result to process said data string.
  2. 4
    The method of any preceding claim, wherein said step of performing a full match search further comprises:determining whether or not a full match for said search key exists within a hash table by: hashing said search key to produce a hash key result;indexing said hash table utilizing said hash key result to find a matching stored pattern;and resolving collisions in said hash table utilizing a pattern search control block.
  3. 5
    The method of any preceding claim, wherein said data string is a Universal Resource Indicator address; said data string element is a URI element; said delimiters comprise period characters or slash characters; and said step of constructing a search key is preceded by the steps of:scanning an IP data packet to determine a first URI element to by parsed;initializing a URI pointer to a first character within said first URI element;and initializing said pattern search prefix to zero.
  4. 6
    A system for performing a pattern match search for a data string having a plurality of characters separated by delimiters, said system comprising:means for defining a first category of characters as delimiters such that all remaining characters are defined as non-delimiters;processing means for constructing a search key by: generating a full match search increment comprising the binary representation of a data string element, wherein said data string element comprises all non-delimiters between a pair of said delimiters;and concatenating a pattern search prefix to said full match search increment to form said search key, wherein said pattern search prefix is a cumulative pattern search result of each previous full match search increment ;processing means for performing a full match search within a lookup table utilizing said search key;processing means response to finding a matching pattern within said lookup table for returning to said step of constructing a search key;and processing means responsive to not finding a matching pattern for utilizing the previous full match search result to process said data string.
  5. 9
    The system of any one of claims 6 to 8, wherein said processing means for performing a full match search further comprises :processing means for determining whether or not a full match for said search key exists within said hash table by: hashing said search key to produce a hash key result;indexing a hash table utilizing said hash key result to find a matching stored pattern;and resolving collisions in said hash table utilizing a pattern search control block.
  6. 10
    The system of any one of claims 6 to 9 , wherein said data string is a Universal Resource Indicator address; said data string element is a URI element; said delimiters comprise period characters or slash characters; and said processing means for constructing a search key further comprises:processing means for scanning an IP data packet to determine a first URI element to by parsed;processing means for initializing a URI pointer to a first character within said first URI element;and processing means for initializing said pattern search prefix to zero.
  7. 11
    A computer program product comprising instructions which, when executed on a data processing apparatus, cause said apparatus to carry out the method as claimed in any one of claims 1 to 5.