IP Library Granted Patent US 7,818,311
Granted Patent B2
US 7,818,311 · App. 11/861,198 · Granted Oct 19, 2010

Complex regular expression construction

Assignee: Microsoft Corporation
View Patent ↗
Loading inventors, assignments & file history…
Monitor This Case
Get email alerts when status or documents change.
Order Certified Copies
Most orders are placed with the USPTO same day — all within 24 business hours.
Order via The Patent Place →
Pre-filled with this patent's details
Quick Facts
Patent No.
US 7,818,311
App. No.
11/861,198
Granted
Oct 19, 2010
Kind
B2
Abstract

A mechanism is provided to facilitate complex textual pattern matching. Regular expressions are specified utilizing a set of rules of various simplicity/complexity. These rules are subsequently employed to generate a more complex regular expression described by the rules, which can be passed to a regular expression engine to identity textual patterns as a function thereof.

Claims (30)

1. A regular expression system, comprising at least one processor coupled to at least one machine-readable storage medium storing instructions executable by the at least one processor to implement:

a rule compilation component configured to receive a specification of primitive rules and to generate a complex regular expression based on the specification of primitive rules, and to detect at least a circular reference and a missing definition;

a regular expression engine configured to receive the complex regular expression and textual data, and to compare the textual data to the complex regular expression to obtain matching data;

wherein the rule compilation component includes

a regular expression grammar component, and

a translator component configured to translate the specification of primitive rules,

based on a grammar provided by the regular expression grammar component, into the complex regular expression, by recursively locating non-terminal rule representations and converting the non-terminal rule representations into the complex regular expression, the complex regular expression being a terminal regular expression; and

an assistance component configured to at least one of interpret or utilize an alternate representation of a language grammar, to infer a rule relating to at least one of parsing or color-coding a language.

2. The system of claim 1 , further comprising an interface component configured to receive the specification of primitive rules.

3. The system of claim 1 , wherein the primitive rules define higher-level rules.

4. The system of claim 1 , wherein the primitive rules each comprise a name and a definition.

5. The system of claim 1 , wherein the grammar provided by the regular expression grammar component includes regular expression grammar rules.

6. The system of claim 1 , wherein the rule compilation component is optimized to generate a non-terminal symbol corresponding to a rule only once.

7. The system of claim 1 , wherein the complex regular expression defines a pattern to parse program language constructs.

8. A regular expression method, comprising using a processor coupled to a memory to perform at least one of the following operations:

receiving a set of rules collectively identifying a pattern, and including non-terminal rules having corresponding symbol definitions;

recursively searching the set of rules for each non-terminal symbol definition;

based on the recursively searching, determining whether a non-terminal symbol is missing and whether a circular reference is detected;

if the recursively searching determines that a non-terminal symbol is missing or a circular reference is detected, generating an error, otherwise continuing the recursively searching;

for each non-terminal symbol found, replacing the non-terminal symbol with an expanded representation;

constructing a terminal representation from each expanded representation;

processing the terminal representation against data to identify matches; and

provisioning of design time assistance including at least one of color-coding, formatting, automatic code completion or error detection.

9. The method claim 8 , further comprising including name definition pairs in the set of rules.

10. The method of claim 9 , further comprising:

defining a higher-level rule as a function of lower-level rules.

11. The method of claim 8 , further comprising computing a non-terminal symbol at most once.

12. The method of claim 8 , further comprising identifying a language grammar associated with the set of rules.

13. The method of claim 8 , further comprising providing a suggestion for automatic statement completion as a function of a rule specification.

14. A computer-readable storage medium tangibly embodying instructions for performing a method according to claim 8 .

Assignments (2)
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Dec 9, 2014
From: MICROSOFT CORPORATION
To: MICROSOFT TECHNOLOGY LICENSING, LLC
Reel/Frame 034542/0001 →
ASSIGNMENT OF ASSIGNOR'S INTEREST Recorded Sep 25, 2007
From: MICHAILOV, ZLATKO VELKOV
To: MICROSOFT CORPORATION
Reel/Frame 019876/0345 →
Continuity (1)
Related Publication 20090083265A1 · Mar 26, 2009