Skip to main content
Solved

StringSearcher only returning the first number in the string


dbryantgeo
Contributor
Forum|alt.badge.img+7

I am reading the source file from an SFTP folder and storing it into an attribute for the purposes of later downloading the right file (as the folder read may contain various files).

I use a StringSearcher transformer twice, once to identify that the files that are an xlslx and again to try and identify the date that is contained in the filename. I'll later discard the older files and only read in and store data from the newest file.

The filenames are formatted like Test_Test_240519.xlslx but the logger/inspector suggests that only the first number is being returned in the destination attribute.

The regex is a simple /d. I have also tried [0-9].

We're currently on FME 2017.0.1.1 but will be upgrading shortly - maybe this is an old bug but it seems odd that I can't find anything about it online?

Best answer by ebygomm

If you want to return the digits in "Test_Test_240519.xlslx" the regex needs to be [0-9]+ or \\d+

View original
Did this help you find an answer to your question?

2 replies

ebygomm
Influencer
Forum|alt.badge.img+31
  • Influencer
  • Best Answer
  • July 23, 2019

If you want to return the digits in "Test_Test_240519.xlslx" the regex needs to be [0-9]+ or \\d+


dbryantgeo
Contributor
Forum|alt.badge.img+7
  • Author
  • Contributor
  • July 25, 2019

@egomm thank you very much, regex is obviously not my strong suit.


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings