Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

String Comparison using Regex in RPE

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.

0 votes

Comments

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 log in 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.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,120

Question asked: Sep 15 '22, 8:43 a.m.

Question was seen: 1,679 times

Last updated: Sep 19 '22, 3:08 a.m.

Confirmation Cancel Confirm