RegExpr limitations

Back to help contents

Numeric limitations

A maximum of 31 subexpressions are supported.

A maximum of 9 lookbacks (\1...\9) are supported.

Performance limitations and suggestions

RegExpr was written in pure Visual Basic and it was meant to support all kinds of regular expressions. These features limit the performance to some extent.

The performance of RegExpr is limited on large input sizes, such as searching for strings in large text files, or processing a large number of files in one run. For higher performance, handle the input in smaller chunks, such as line by line.

Use ^ at the start of the regular expression whenever possible. RegExpr has an optimization that allows for faster execution when the matches are required to be at the start of the input string.

You can avoid most performance problems by using some tricks to limit the number of required calls at run-time. A good trick is to use extra If conditions to pre-select the potential matching strings, like this:

If Instr(Text, "@") > 0 Then
  ' Looks like an email address
  If RegExpr("\S+@\S+") Then
    ' It is an email address
    ' Do your processing here
  End If
End If

©Aivosto Oy