Skip to main content

regexp2

Availability

Agent

Description

The regexp2 delegate object provides a series of methods which allow you to use and evaluate regular expressions within your Squirrel code. Based on the Google re2 regular expression engine, regexp2 is a considerable improvement upon the standard Squirrel regular expression evaluation functionality provided by regexp and we recommended new code uses it in preference to the standard functionality. However, re2 memory usage issues mean that regexp2 is currently only available in agent code. A regexp2 regular expression is limited to 256 characters, and each agent is only allowed to have up to ten regexp2 objects simultaneously. The standard functionality will continue to be offered for device code and to maintain compatibility with older agent code.

Member Entities

The regexp2 object has the following member methods:

  • regexp2.capture()Finds and tabulates sub-strings which match the target regular expression
  • regexp2.match()Determines whether the target regular expression matches any part of the passed string
  • regexp2.search()Finds the first sub-string within the passed string which matches the target regular expression

The regexp2 object has the following member function:

  • regexp2()Instantiates a regular expression object