Choose Language Hide Translation Bar
Occasional Contributor

unable to use regex function to compare to variable

Hi all , i facing a problem to compare to string inside a variable. This works well when i dont use varialbe , can somemore please help ? The result is always "." even though it one string is a substring of another.  


If( regex(char(stepproduct),char(step),"1")=="1",
				stepproduct = Substitute( Char( stepproduct ), step, "" );
				tableExist = 1;
				tableExist = 0;
0 Kudos

Re: unable to use regex function to compare to variable

It would help if you could show a few rows of the data table or give examples of values for stepproduct and step. What are the values of these values prior to calling the If() function? Also, are they both numbers?


Do you mean the result of the Regex() function, the Substitute() function, or the If() function is missing?


This case is simple and will certainly work with the correct regular expression, it might be easier to use the Contains() function.

Learn it once, use it forever!