NI TestStand Idea Exchange

Showing results for 
Search instead for 
Did you mean: 

Add Regular Expression comparison type to String Value Test

Status: Completed

This is available in TestStand 2020

It would be helpful to be able to provide a regular expression (like Labview Match Pattern) as a string value test limit.  We often look for a pattern of data within a string rather than a constant.

Maybe also a regular expression function within the built in functions within TestStand expressions would be a help also.  This could provide more flexibility if a user needs it.  For example adding option to gain match position, and match length as well as give the option to search in reverse and ignore case.

Active Participant

With TestStand 2010, the .NET Adapter can operate directly on TestStand strings. This means that you can use it to leverage the .NET Framework regular expression functionality. This might satisfy some of your use cases (though I can see that it isn't as convenient as having regex support directly in the TestStand expression language).

Active Participant

If this moves forward with development, don't forget about the ability to have "no comparison" / "Log" capability for strings as well. 


I also would think it convenient to use Regular Expressions in the built-in String functions such as Find( MyString, MyReguarExpression).  TS1012 already uses Regular Expressions in search criteria, but why not in built-in String functions as well?

Active Participant

For those who have arrived here and want to know how to perform these kinds of tasks with .NET, here is the class I used successfully.




Incidentally, one thing that I found confusing is that when you're filling out a regex pattern that includes a backslash, you need two sets of escape sequences - one for TestStand and one for the regular expression. Thus, "\\\\" is a single backslash when part of the "pattern" parameter.


Native support sure would be a nice touch on NI's part - I would use it all the time.

Active Participant

Linking Mr. Jim's related idea here:
Active Participant
Status changed to: Under Consideration
Active Participant
Status changed to: Completed

This is available in TestStand 2020