It's all about the answers!

Ask a question

String Comparison using Regex in RPE


Chidambaram L (23424390) | asked Sep 15 '22, 8:43 a.m.
edited Sep 15 '22, 8:45 a.m.

We are using RPE 7.0.

Using regex, wanted to check if a string ends with xx.0; where x will be an Integer.
var test123 = "Version 11.0";     
_sessionLogger.info ("REGEX INDEX OF: " + test123.indexOf(" [0-9]*.0$"));
Second line returns -1. While expected result is 8.

-1 is expected when 
test123 = "Version x1.0"  
test123 = "Version"
How to use regex in RPE for string comparison.


Comments
Ralph Schoon commented Sep 19 '22, 3:08 a.m.
FORUM ADMINISTRATOR / FORUM MODERATOR / JAZZ DEVELOPER

There are a lot of resources around, that explain how Regex works in the various languages. I would suggest to look there. It is probably too much to ask a forum to write the regex expression for you. 

Be the first one to answer this question!


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.