Skip to main content

"FindRegEx(str, regExp, [startIdx], [caseSensitive], [-1])

... If 

-1 
is specified, 
FindRegEx()
 returns the index in 
str 
starting at 
startIdx
 from the end of 
str 
going backwards."

 

I cannot make the backwards search work. Did I do anything wrong?

0684Q00000ArAkeQAF.png 

Tried with Desktop 2019 and 2018. It worked in the past as I remember.

 

I think it's a bug on the function or the documentation. I remember that I reported the inconsistency to Safe support four years ago, am surprised the issue is still outstanding.

Forgot the case number, but I found out this workspace which I sent to Safe in order to describe the issue at that time.

FindRegEx_b15539.fmw: created with FME 2015 build 15539, run with FME 2019.1.2

Hope someone from Safe clarifies this. @danatsafe


I think it's a bug on the function or the documentation. I remember that I reported the inconsistency to Safe support four years ago, am surprised the issue is still outstanding.

Forgot the case number, but I found out this workspace which I sent to Safe in order to describe the issue at that time.

FindRegEx_b15539.fmw: created with FME 2015 build 15539, run with FME 2019.1.2

0684Q00000ArLseQAF.png

Hope someone from Safe clarifies this. @danatsafe

@takashi Unfortunately the current doc is misleading.  FindRegEx can't search backwards but the start of the forward search can be set from the end (counting backwards).  @jingking If you expect FindRegEx to return 0 for 12345L, then instead try

@Evaluate(@StringLength(12345L)-1-@FindRegEx(12345L,L))

@takashi Unfortunately the current doc is misleading.  FindRegEx can't search backwards but the start of the forward search can be set from the end (counting backwards).  @jingking If you expect FindRegEx to return 0 for 12345L, then instead try

@Evaluate(@StringLength(12345L)-1-@FindRegEx(12345L,L))

Thanks for the clarification. That makes sense.