The use of Regular Expression Operands involves the use of command operands and command codes that can be cryptic and unfamiliar, especially if you don't use them frequently. As extensively as these features are documented, they could fail or could produce results you may not understand or did not expect. In many cases, you may only observe these features seemingly doing nothing, with no explanation as to what went wrong.


The SPFTest program was design to provide you with a 'scratch pad' for experimenting with Regular Exprerssions, and immediately see results, without having to set up test data in an SPFLite edit session. Since these tests don't involve actual data, you can't harm anything by running these tests, and you can quickly repeat tests without having to issue SPFLite primary commands.


The SPFTest program can be accessed in two ways:


    • A shortcut is available in the SPFLite Start menu folder


    • Within SPFLite, you may enter a TEST command, which will start a copy of the SPFTest program. 


The SPFTest program, once started, runs independently of SPFLite itself, and is not dependent on it, so you can switch between the two without one program affecting or interfering with the other.



Regular Expression Strings



This is the testing interface for testing Regular Expression strings. The top half of the screen contains three input fields.


Default Case

Regex character matching can be defaulted to Case Sensitive or Case Insensitive. This input field is where you can specify the default you wish. Enter  for case sensitive or T for Case insensitive. Note: within a Regex string, this default can be overridden with a special code. See the Specifying a Regular Expression article for more information.


Some aspects of regular expressions will behave differently, based on what the current CASE setting is within SPFLite. This field is used to simulate whether CASE C or CASE T is in effect when you execute the given regular expression.


Source string

This is the text string against which the Regex test will be performed. Think of it as being a sample line from the Edit file.


Regex Expression

The Regex expression to be tested. Note: In an actual SPFLite command, this would be included within the quotes of an R-Type literal. In SPFTest, do not specify this string with the R"xxx" format. Leave the R and quote marks off, and only enter the regular expression itself.



Complete these three fields and Press Enter, or click the Run Test button. The results will be displayed in the bottom half of the screen. If a matching string is found, it will be displayed in the upper box, surrounded by | characters. (like the |ghi| in the image above)   The lower box will contain information about the located match string, or it will contain any error messages if the test is unsuccessful.


The Regular Expression syntax now accepted is that of the well-known, open-source PCRE regular expression engine. 


For a full explanation of Regular Expressions, see Specifying a Regular Expression




Created with the Personal Edition of HelpNDoc: Free EPub and documentation generator