Nomad
Nomad

Reputation: 781

camel route xml multiple file name regex

I am trying to pull the files with name '123*.txt', '987*.txt' from the sftp server. for that the route xml in camel configured as shown below. It is not processing both files, I have even tried as 123*.txt,987*.txt. Suggest the proper regex I can use here to process both files.

<?xml ...
<route.....
...
..
<from nullPayload="IGNORE">
              <uri>ftp://localhost/</uri>
        <options>
               <option name="username">uname</option>
               <option name="password">pwd</option>
               <option name="include">123.*\.txt,987.*\.txt</option>
        </options>

       </from>
       <to>
           <uri>file://C:/folder</uri>
       </to>

</route>

Upvotes: 1

Views: 1144

Answers (1)

Eder
Eder

Reputation: 1884

Try using the following pattern:

^(?:123|987)[A-Za-z0-9-_\s\.]*\.txt$

Regular expression visualization

Debuggex Demo

Upvotes: 3

Related Questions