user2916464
user2916464

Reputation: 501

simple regular expression in XML

I am trying to move a number of files using Mule from one directory to another. File names are like ABC_123.xml, ABC_456.xml etc. the pattern being ABC_whatever.xml. I thought

<file:filename-regex-filter pattern="(^ABC).xml" caseSensitive="true"/>

would do the job. But it does not seem to be working. Where should I even look for documentation? any help?

Following is the configuration xml.

<?xml version="1.0" encoding="UTF-8"?>

<mule xmlns:file="http://www.mulesoft.org/schema/mule/file" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation" xmlns:spring="http://www.springframework.org/schema/beans" version="EE-3.4.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd
http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd
http://www.mulesoft.org/schema/mule/file http://www.mulesoft.org/schema/mule/file/current/mule-file.xsd">
    <flow name="basicTut1" doc:name="basicTut1">
        <file:inbound-endpoint path="/home/Input" moveToDirectory="/home/Output" responseTimeout="10000" doc:name="File">
            <file:filename-regex-filter pattern="(^ABC).xml" caseSensitive="true"/>
        </file:inbound-endpoint>
        <logger message="#[payload]" level="INFO" doc:name="Logger"/>
    </flow>
</mule>

Upvotes: 0

Views: 1192

Answers (1)

evhen14
evhen14

Reputation: 1927

Your regex should be fixed

^ABC.*\.xml$

Upvotes: 1

Related Questions