# US 2024/0176823 A1 · Regular expression matching in dictionary-encoded strings

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2024/0176823 A1
- Document ID: US20240176823A1
- Status: Published application
- Kind: A1
- Application number: 18/070,791
- Filed: 2022-11-29
- Published: 2024-05-30
- Earliest claimed: 2022-11-29
- Assignees: Oracle International Corporation
- Applicants: Oracle International Corporation
- Inventors: GIACOMO FABRIS; ALEKSEI KASHUBA; ALEXANDER ULRICH
- Web page: https://patentgrep.com/patent/US20240176823A1

## CPC

- G06F 16/90344: {by using string matching techniques}
- G06F 9/4498: {Finite state machines}
- G06F: ELECTRIC DIGITAL DATA PROCESSING (computer systems based on specific computational models G06N)

## Abstract

Techniques are described for generating an encoded-string automaton for a regex pattern from a decoded-string automaton of the regex pattern. In an embodiment, the process obtains a decoded-string automaton of the regex pattern and applies unique decoded string value(s) from the dictionary of the encoding. When applied at a selected state in the decoded-string automaton, the application may yield a transition to at least one target state in the decoded-string automaton for a unique dictionary value. Such a transition generates a transition in the encoded-string automaton from an encoded state corresponding to the selected state in the decoded-string automaton to a target state in the encoded-string automaton corresponding to the target state in the decoded-string automaton. The generated transition in the encoded-string automaton is conditioned on the token of the unique decoded string value in the dictionary.

## Claims

### Claim 1

A computer implemented method comprising:
obtaining a decoded-string automaton of a regex pattern, wherein the decoded-string automaton applies the regex pattern on a decoded input string and generates a result for matching the regex pattern in the decoded input string;
generating an encoded-string automaton of the regex pattern from the decoded-string automaton, wherein the encoded-string automaton applies the regex pattern on one or more tokens that encode the decoded input string based on a dictionary of a data set of input strings and generate the same result for matching the regex pattern in the decoded input string;
wherein the dictionary includes mappings of a plurality of unique decoded string values to a plurality of tokens that includes the one or more tokens;
wherein generating the encoded-string automaton of the regex pattern comprises:
based on the decoded-string automaton, determining a transition, in the encoded-string automaton, from a source encoded state corresponding to a source decoded state in the decoded-string automaton to a target encoded state corresponding to a target decoded state in the decoded-string automaton, the transition being conditioned on at least one token.

### Claim 2 (depends on 1)

The method of claim 1, further comprising:
replicating a plurality of decoded states of the decoded-string automaton to generate a plurality of corresponding encoded states in the encoded-string automaton.

### Claim 3 (depends on 1)

The method of claim 1, further comprising:
applying, at the source decoded state in the decoded-string automaton, a particular unique decoded value from the plurality of unique decoded string values of the dictionary, wherein the particular unique decoded value maps to the at least one token;
determining, in the decoded-string automaton, a set of target decoded states that are reached from the source decoded state by the applying the particular unique decoded value at the source decoded state in the decoded-string automaton;
generating, in the encoded-string automaton, one or more transitions, from the source encoded state corresponding to the source decoded state, to a set of target encoded states, each of the set of target encoded states corresponding to each of the set of target decoded states, wherein the one or more transitions are conditioned on the at least one token.

### Claim 4 (depends on 3)

The method of claim 3, wherein the set of target decodes states includes a final decoded state of the decoded-string automaton, the method further comprising:
generating, in the encoded-string automaton, a new encoded state and a new empty transition between the new encoded state and a final encoded state corresponding to the final decoded state of the decoded-string automaton;
generating, in the encoded-string automaton, a final transition between the source encoded state to the new encoded state, the final transition being conditioned on the at least one token.

### Claim 5 (depends on 1)

The method of claim 1, further comprising:
determining that no transition exists, from an initial source decoded state to a final decoded state in the decoded-string automaton based on applying the plurality of unique decoded string values at the initial source decoded state in the decoded-string automaton without reaching any final decoded state in the decoded-string automaton;
based on determining that no transition exists, determining that no string exists in the data set of the dictionary that matches the regex pattern.

### Claim 6 (depends on 1)

The method of claim 1, wherein the decoded-string automaton is a deterministic finite state automaton or a non-deterministic finite state automaton.

### Claim 7 (depends on 1)

The method of claim 1, wherein the encoded-string automaton is a non-deterministic finite state automaton, the method further comprising converting the encoded-string automaton to a deterministic finite state automaton.

### Claim 8 (depends on 1)

The method of claim 1, wherein the plurality of unique decoded string values in the dictionary are unique column values of a particular column in a database or a portion thereof.

### Claim 9 (depends on 1)

The method of claim 1, wherein the plurality of unique decoded string values in the dictionary are unique n-grams.

### Claim 10 (depends on 1)

The method of claim 1, further comprising:
generating an automaton object from the encoded-string automaton;
storing the automaton object in automaton object store in association with the regex pattern.

### Claim 11

One or more non-transitory computer-readable media storing a set of instructions, wherein the set of instructions includes instructions, which, when executed by one or more hardware processors, cause:
obtaining a decoded-string automaton of a regex pattern, wherein the decoded-string automaton applies the regex pattern on a decoded input string and generates a result for matching the regex pattern in the decoded input string;
generating an encoded-string automaton of the regex pattern from the decoded-string automaton, wherein the encoded-string automaton applies the regex pattern on one or more tokens that encode the decoded input string based on a dictionary of a data set of input strings and generate the same result for matching the regex pattern in the decoded input string;
wherein the dictionary includes mappings of a plurality of unique decoded string values to a plurality of tokens that includes the one or more tokens;
wherein generating the encoded-string automaton of the regex pattern comprises:
based on the decoded-string automaton, determining a transition, in the encoded-string automaton, from a source encoded state corresponding to a source decoded state in the decoded-string automaton to a target encoded state corresponding to a target decoded state in the decoded-string automaton, the transition being conditioned on at least one token.

### Claim 12 (depends on 11)

The one or more non-transitory computer-readable media of claim 11, wherein the set of instructions further includes instructions, which, when executed by said one or more hardware processors, cause:
replicating a plurality of decoded states of the decoded-string automaton to generate a plurality of corresponding encoded states in the encoded-string automaton.

### Claim 13 (depends on 11)

The one or more non-transitory computer-readable media of claim 11, wherein the set of instructions further includes instructions, which, when executed by said one or more hardware processors, cause:
applying, at the source decoded state in the decoded-string automaton, a particular unique decoded value from the plurality of unique decoded string values of the dictionary, wherein the particular unique decoded value maps to the at least one token;
determining, in the decoded-string automaton, a set of target decoded states that are reached from the source decoded state by the applying the particular unique decoded value at the source decoded state in the decoded-string automaton;
generating, in the encoded-string automaton, one or more transitions, from the source encoded state corresponding to the source decoded state, to a set of target encoded states, each of the set of target encoded states corresponding to each of the set of target decoded states, wherein the one or more transitions are conditioned on the at least one token.

### Claim 14 (depends on 13)

The one or more non-transitory computer-readable media of claim 13, wherein the set of target decodes states includes a final decoded state of the decoded-string automaton, and wherein the set of instructions further includes instructions, which, when executed by said one or more hardware processors, cause:
generating, in the encoded-string automaton, a new encoded state and a new empty transition between the new encoded state and a final encoded state corresponding to the final decoded state of the decoded-string automaton;
generating, in the encoded-string automaton, a final transition between the source encoded state to the new encoded state, the final transition being conditioned on the at least one token.

### Claim 15 (depends on 11)

The one or more non-transitory computer-readable media of claim 11, wherein the set of instructions further includes instructions, which, when executed by said one or more hardware processors, cause:
determining that no transition exists, from an initial source decoded state to a final decoded state in the decoded-string automaton based on applying the plurality of unique decoded string values at the initial source decoded state in the decoded-string automaton without reaching any final decoded state in the decoded-string automaton;
based on determining that no transition exists, determining that no string exists in the data set of the dictionary that matches the regex pattern.

### Claim 16 (depends on 11)

The one or more non-transitory computer-readable media of claim 11, wherein the decoded-string automaton is a deterministic finite state automaton or a non-deterministic finite state automaton.

### Claim 17 (depends on 11)

The one or more non-transitory computer-readable media of claim 11, wherein the encoded-string automaton is a non-deterministic finite state automaton, and wherein the set of instructions further includes instructions, which, when executed by said one or more hardware processors, cause converting the encoded-string automaton to a deterministic finite state automaton.

### Claim 18 (depends on 11)

The one or more non-transitory computer-readable media of claim 11, wherein the plurality of unique decoded string values in the dictionary are unique column values of a particular column in a database or a portion thereof.

### Claim 19 (depends on 11)

The one or more non-transitory computer-readable media of claim 11, wherein the plurality of unique decoded string values in the dictionary are unique n-grams.

### Claim 20 (depends on 11)

The one or more non-transitory computer-readable media of claim 11, wherein the set of instructions further includes instructions, which, when executed by said one or more hardware processors, cause:
generating an automaton object from the encoded-string automaton;
storing the automaton object in automaton object store in association with the regex pattern.
