This documentation has been moved
Regex Engine Performance Enhancement
Downloads: This chapterpdf (PDF - 127.0KB) The complete bookPDF (PDF - 3.24MB) | Feedback

Regex Engine Performance Enhancement

Table Of Contents

Regex Engine Performance Enhancement

Finding Feature Information

Contents

Prerequisites for Regex Engine Performance Enhancement

Information About Regex Engine Performance Enhancement

Regular Expression Overview

Default Regular Expression Engine

New Regular Expression Engine Selection

How to Change the Regular Expression Engine

Selecting the New Regular Expression Engine

Examples

Additional References

Related Documents

Standards

MIBs

RFCs

Technical Assistance

Feature Information for Regex Performance Enhancement


Regex Engine Performance Enhancement


Last Updated: August 17, 2010

The Regex Engine Performance Enhancement feature introduces a new regular expression engine that is designed to process complex regular expressions. This new regular expression engine does not replace the existing engine. The existing engine is preferred for simple regular expressions and is the default engine and in Cisco IOS software. Either engine can be selected from the command-line interface (CLI).

Finding Feature Information

Your software release may not support all the features documented in this module. For the latest feature information and caveats, see the release notes for your platform and software release. To find information about the features documented in this module, and to see a list of the releases in which each feature is supported, see the "Feature Information for Regex Performance Enhancement" section.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.

Contents

Prerequisites for Regex Engine Performance Enhancement

Information About Regex Engine Performance Enhancement

How to Change the Regular Expression Engine

Additional References

Feature Information for Regex Performance Enhancement

Prerequisites for Regex Engine Performance Enhancement

The regular expression engine can be selected only under a Border Gateway Protocol (BGP) routing process in router configuration mode. So, the engine can be changed only after BGP has been enabled.

Information About Regex Engine Performance Enhancement

Regular Expression Overview

Default Regular Expression Engine

New Regular Expression Engine Selection

Regular Expression Overview

A regular expression is a pattern to match against an input string. You specify the pattern that a string must match when you compose a regular expression. Matching a string to the specified pattern is called "pattern matching." Pattern matching either succeeds or fails.

A regular expression can be a single-character pattern or a multiple-character pattern. That is, a regular expression can be a single character that matches the same single character in the input string or multiple characters that match the same multiple characters in the input string.

Default Regular Expression Engine

The default Cisco IOS regular expression engine uses a recursive algorithm. This engine is effective but uses more system resources as the complexity of regular expressions increase. The recursive algorithm works well for simple regular expressions, but is less efficient when processing very complex regular expressions because of the backtracking that is required by the default engine to process partial matches. In some cases, CPU watchdog timeouts and stack overflow traces have occurred because of the length of time that the default engine requires to process very complex regular expressions.

New Regular Expression Engine Selection

The Regex Engine Performance Enhancement feature introduces a deterministic processing time regular expression engine in Cisco IOS software. This new engine does not replace the default regular expression engine. The new engine employs an improved algorithm that eliminates excessive back tracking and greatly improves performance when processing complex regular expressions. When the new engine is enabled, complex regular expressions are evaluated more quickly, and CPU watchdog timeouts and stack overflow traces will not occur. However, the new regular expression engine takes longer to process simple regular expressions than the default engine.

We recommend that you use the new regular expression engine if you need to evaluate complex regular expressions or if you have observed problems related to evaluating regular expressions. We recommend that you use the default regular expression engine if you use only simple regular expressions. The new engine can be enabled by entering the bgp regexp deterministic command under a BGP routing process. The default regular expression engine can be reenabled by entering the no form of this command.

How to Change the Regular Expression Engine

Selecting the New Regular Expression Engine

We recommend that you use the new regular expression engine if you need to evaluate complex regular expressions or if you have observed problems related to evaluating regular expressions. We recommend that you use the default regular expression engine if you only use simple regular expressions.

SUMMARY STEPS

1. enable

2. configure terminal

3. router bgp as-number

4. bgp regexp deterministic

5. exit

DETAILED STEPS

 
Command or Action
Purpose

Step 1 

enable

Example:

Router> enable

Enables privileged EXEC mode.

Enter your password if prompted.

Step 2 

configure terminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3 

router bgp as-number

Example:

Router(config)# router bgp 1

Enters router configuration mode, and creates a BGP routing process.

Step 4 

bgp regexp deterministic

Example:

Router(config-router)# no bgp regexp deterministic

Configures Cisco IOS to use a deterministic regular expression engine.

The default regular expression engine in Cisco IOS software is nondeterministic.

The default engine can be restored by entering the no form of this command.

Step 5 

exit

Example:

Router(config-router)# exit

Exits router configuration mode, and enters global configuration mode.

Examples

The following example configures Cisco IOS software to use the default regular expression engine:

router bgp 1
 no bgp regexp deterministic 

The following example configures Cisco IOS software to use the deterministic processing time regular expression engine:

router bgp 1
 bgp regexp deterministic 

Additional References

The following sections provide references related to the Regex Engine Performance Enhancement feature.

Related Documents

Related Topic
Document Title

Regular Expressions

"Regular Expressions" appendix of the Cisco IOS Terminal Services Configuration Guide


Standards

Standards
Title

No new or modified standards are supported by this feature, and support for existing standards has not been modified by this feature.


MIBs

MIBs
MIBs Link

No new or modified MIBs are supported by this feature, and support for existing MIBs has not been modified by this feature.

To obtain lists of supported MIBs by platform and Cisco IOS release, and to download MIB modules, go to the Cisco MIB website on Cisco.com at the following URL:

http://www.cisco.com/public/sw-center/netmgmt/cmtk/mibs.shtml


RFCs

RFCs
Title

No new or modified RFCs are supported by this feature, and support for existing standards has not been modified by this feature.


Technical Assistance

Description
Link

The Cisco Support website provides extensive online resources, including documentation and tools for troubleshooting and resolving technical issues with Cisco products and technologies.

To receive security and technical information about your products, you can subscribe to various services, such as the Product Alert Tool (accessed from Field Notices), the Cisco Technical Services Newsletter, and Really Simple Syndication (RSS) Feeds.

Access to most tools on the Cisco Support website requires a Cisco.com user ID and password.

http://www.cisco.com/techsupport


Feature Information for Regex Performance Enhancement

Table 1 lists the release history for this feature.

Use Cisco Feature Navigator to find information about platform support and software image support. Cisco Feature Navigator enables you to determine which software images support a specific software release, feature set, or platform. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn. An account on Cisco.com is not required.


Note Table 1 lists only the software release that introduced support for a given feature in a given software release train. Unless noted otherwise, subsequent releases of that software release train also support that feature.


Table 1 Feature Information for Regex Performance Enhancement 

Feature Name
Releases
Feature Information

Regex Performance Enhancement

12.0(26)S
12.3(4)T
12.2(22)S
Cisco IOS
XE 3.1.0SG

The Regex Engine Performance Enhancement feature introduces a new regular expression engine that is designed to process complex regular expressions. This new regular expression engine does not replace the existing engine. The existing engine is preferred for simple regular expressions and is the default engine and in Cisco IOS software. Either engine can be selected from the command-line interface (CLI).

The following command was introduced: bgp regexp deterministic.