Search
Other ReReplacer questions
Forum

HowTo prevent ReReplacer from replacing Code in Script using XML

Fachliche Leitstelle NWR's Avatar Fachliche Leitstelle NWR
I have an XML with different replacement rules (RexEx and non-RegEx). Unfortunately it also replaces elements within JavaScript functions (inside the Body). This is a problem. How can I prevent this since it prevents the script from working.

Settigs:
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
Enable in area = Body (not in Head)
Enable in feeds = Yes
Enable in Admin = No
Enable in edit forms = No
Enable in HTML tags = No

No Conditions

Example from XML:

<item>
<search>HuH</search>
<replace><abbr title="Waffenhändler und -hersteller">HuH</abbr></replace>
<params>
<param name="regex" value="1" />
<param name="casesensitive" value="1" />
</params>
</item>
Peter van Westen's Avatar Peter van Westen ADMIN
First of all, "HuH" doesn't need the "regex" setting to be on. It is just text.
By enabling that, the other non-regex settings won't have an effect, like the "Word Search" setting.

It pretty much comes down to: make your searches smarter, so that it only replaces the cases where you actually want it.
If you can't rely on Word Search, you will need to extend your Regular Expression to do what you need.

What that is, fully depends on your use case.
Please post a rating at the Joomla! Extensions Directory
Fachliche Leitstelle NWR's Avatar Fachliche Leitstelle NWR
I agree, that my example was not the best since it is not RegEx but the question remains:

Is there a parameter to prevent ReReplacer to replace content within a JavaScript using XML?

The documentation does not list all parameters that can be used within an XML file? Do you have additional information on parameters within XML?
Peter van Westen's Avatar Peter van Westen ADMIN
There is no parameter to magically do that.
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