NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

regular expression

Solved!
Go to solution

According to link below, TS support some regular expression.  Can anyone provide an example of where to write the regular expressions ?

I might be easier to do it via an external .net module, but if TS supports it, i might go with that.

 

http://zone.ni.com/reference/en-XX/help/370052N-01/tsref/infotopics/find_regular_expressions/

0 Kudos
Message 1 of 6
(6,098 Views)

If you are using a PropertyObject Search method there is a parameter called SearchOptions.  It requires one of the SearchOptions Constants.  One of those is called SearchOptions_RegExpr.  When this is passed for that parameter then the search text can contain regular expression characters.  This is of course 1 example.

 

What specifically are you wanting.  Maybe there is an easier way?

 

Hope this helps,

jigg
CTA, CLA
testeract.com
~Will work for kudos and/or BBQ~
0 Kudos
Message 2 of 6
(6,074 Views)

 

I wish to take this string:

{x=8.28504, y=0.10767,z=-0.26559}

 

And get x,y,z values in seperate varibles.

 

can be done in C# with this regex:

{x=(?<x>-?\d\.\d{5})\,y=(?<y>-?(-|)\d\.\d{5})\,z=(?<z>-?(-|)\d\.\d{5})}

 

I have made a piece of code for that, however it would be nice to do it directly in TS.

 

0 Kudos
Message 3 of 6
(6,007 Views)
Solution
Accepted by topic author NikolajEgeskovOstergaard

HI

 

Yes there is a PropertyObject.Search Member but  the result is from  SearchResults so i wonder how to use this in executing sequence ?!

What about a simple workaround by using just  4 lines in Exression statement to achive this by using split and trim ?

 

Regards

 

Juergen

--Signature--
Sessions NI-Week 2017 2016
Feedback or kudos are welcome
0 Kudos
Message 4 of 6
(5,989 Views)

@NikolajEgeskovOstergaard wrote:

 

I wish to take this string:

{x=8.28504, y=0.10767,z=-0.26559}

 

And get x,y,z values in seperate varibles.

 

can be done in C# with this regex:

{x=(?<x>-?\d\.\d{5})\,y=(?<y>-?(-|)\d\.\d{5})\,z=(?<z>-?(-|)\d\.\d{5})}

 

I have made a piece of code for that, however it would be nice to do it directly in TS.

 


 

 

You can also use an Action step with the .NET adapter to directly call the .NET framework regular expression APIs to do this.

 

Hope this helps,

-Doug

0 Kudos
Message 5 of 6
(5,975 Views)

Thanks for the support.

I've not yet tried your suggestion Doug, but i intend to.

0 Kudos
Message 6 of 6
(5,917 Views)