joekreif
Level 3

regexp not working

Hello.

I am trying to have a regular expression rule that ensures a number between 150-199 is entered. My rule shows:

$input_num$ Does not match ^[1][5-9][0-9]$

if this rule fails it suppose to Jump back to the label above the input panel. However, no matter what i enter, it never fails and proceeds to the next action.

Please help, we need this to work for us.

Thanks!
Joe
Labels (1)
0 Kudos
5 Replies
jerome_IA
Level 9

Hello,

Simply try ^[1][5-9][0-9]$DOLLAR$ instead

Jerome
0 Kudos
joekreif
Level 3

Hello Jerome.

Thanks for the response, but i cannot get it to work.

I changed it so to just display a message panel and here is what it does:

Input panel: enter number 150-199 range into $input_num$
msg panel 1: you entered wrongly - $input_num$
rule: $input_num$ Does not match ^[1][5-9][0-9]$DOLLAR$
msg panel 2: you entered rightly - $input_num$
rule: $input_num$ Matches ^[1][5-9][0-9]$DOLLAR$

i execute it, and enter 150 and i get the first msg panel as if the number did not match. When i hit next, i do not get the second panel. So, i start the process again.

I execute it, and enter 5555 and i get the same results above, where the first msg panel displays and not the second.

I am thinking that rules are not working properly in my Enterprise 2009 edition. I added a new:

msg panel 3: you entered right value
rule (compare install variable): $input_num$ equals 150

and i reran it and entered 150, and again only the 1st msg panel appeared.

What do you think is my problem? I have been using IA for about a year. I just upgraded from version 8 to 2009. Could this be a bug?

Thanks!
Joe
0 Kudos
joekreif
Level 3

i changed the panel 3 rule to be:

rule (compare install variable): $input_num$ equals "150"

Then, it displays panel 3.

So, why does the regular expressions not work right?

Joe
0 Kudos
joekreif
Level 3

Okay, i changed it to be within quotes and it works,

150 entered - matches "[1][5-9][0-9]"

1501 entered - does not match
250 entered - does not match

So, it looks like we are a go on with surrounding the regexp with quotes.

Thanks!
Joe
0 Kudos
jerome_IA
Level 9

Hello,

In fact, the "problem" is not in the regular expression, but in the variable definition.

Check the get user input help from there: file:///C:/Program%20Files/Macrovision/InstallAnywhere%202009/manual/wwhelp/wwhimpl/js/html/wwhelp.htm?href=introduction.htm

When using "textfields", those result variables are double quoted.

So I guess you should call the variable "$input_num_1$" and reset you regular expression like it was.

--Jerome
0 Kudos