Search
Other ReReplacer questions
Forum

Different replacement of "cat" and "cat-flap"

Fachliche Leitstelle NWR's Avatar Fachliche Leitstelle NWR
I am using a XML file to replace words in my articles. Mostly it works fine but I have an issue I cannot solve:

-- XML
<item>
<search>cat</search>
<replace>little hairy something on four paws</replace>
</item>
<item>
<search>cat-flap</search>
<replace>door to heaven</replace>
</item>

-- Result
The quick brown cat is running... ==> The quick brown little hairy something on four paws is running... ==> OK
The cat-flap was broken ==> The little hairy something on four paws-flap was broken ==> not what I need

-- Settings
Use XML File = Yes
Regular Expressions = No
Treat as List = No
Word Search = Yes
Case sensitive = Yes
Maximum Replacements = Replace all
Thorough = No
Strip Wrapping Paragraphs = No
Replace with PHP = No

Is there something I can change, so it will work?

Best regards,
Florian
Peter van Westen's Avatar Peter van Westen ADMIN
The Word Search option won't solve this for you, as according to the Word Search 'cat' is a separate word in 'cat-flap'.

So you would need to solve this with Regular Expressions. Then you can tell ReReplacer exactly when and when not to replace the occurrences of 'cat' based on your personal preferences.
Please post a rating at the Joomla! Extensions Directory
You can only post on the extension support forum if you have an active subscription and you log in

Buy a Pro subscription