Support Questions

Find answers, ask questions, and share your expertise

apache Nifi getFTP regex filter?

New Contributor

I want to import all files that are from A.


I want to import all files with this format [ABC_YYYYMMDD.txt] from FTP.

How should I express [File Filter Regex] field?


ex) abc_20200324.txt


Master Guru



You could use a Java Regular expression like this:


  The above will match everything before "_" and then must match a number that starts with "20", followed by  to digits "\d\d" (this matches any year in 2001-2099), followed by  "(0[1-9]|1[012])" (this matches months 01-09 or 10,11,12), followed by "(0[1-9]|[12][0-9]|3[01])" (this matches days 01-09 or 10-29 or 30 or 31), ending with the text string ".txt".


There are some good regex testers available on the web you may find useful.


Hope this helps,



Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.