To cater for certain foreign character words, we use an XML file of search and replace terms to switch out on our website, (for example, "sister" in French is "sur"):
soeur => sur
However, "Nunn" in French is "Sur", (with an uppercase S), but due to the case-insensitive sandr, is also getting replaced with "sur", (lowercase s). Here is our code:
<$file = "oelist.xml">
<read $file>
<$data = $ret>
<rex row ">><term>\P=!</term>+\F</term>" $data>
<$term = $ret>
<rex ">><termid>\P=!</termid>+\F</termid>" $term>
<$needles = $ret>
<rex ">><termuc>\P=!</termuc>+\F</termuc>" $term>
<$replace = $ret>
<sandr $needles $replace $TEXT>
<$TEXT = $ret>
Here is the structure of our xml file:
<term><termid>boeuf</termid><termuc>buf</termuc></term>
<term><termid>coeur</termid><termuc>cur</termuc></term>
<term><termid>soeur</termid><termuc>sur</termuc></term>
<term><termid>Soeur</termid><termuc>Sur</termuc></term>
etc...
Is there an efficient way to perform this function with case sensitivity, (so that "soeur" becomes "sur" and "Soeur" becomes "Sur")?
Thanks!
soeur => sur
However, "Nunn" in French is "Sur", (with an uppercase S), but due to the case-insensitive sandr, is also getting replaced with "sur", (lowercase s). Here is our code:
<$file = "oelist.xml">
<read $file>
<$data = $ret>
<rex row ">><term>\P=!</term>+\F</term>" $data>
<$term = $ret>
<rex ">><termid>\P=!</termid>+\F</termid>" $term>
<$needles = $ret>
<rex ">><termuc>\P=!</termuc>+\F</termuc>" $term>
<$replace = $ret>
<sandr $needles $replace $TEXT>
<$TEXT = $ret>
Here is the structure of our xml file:
<term><termid>boeuf</termid><termuc>buf</termuc></term>
<term><termid>coeur</termid><termuc>cur</termuc></term>
<term><termid>soeur</termid><termuc>sur</termuc></term>
<term><termid>Soeur</termid><termuc>Sur</termuc></term>
etc...
Is there an efficient way to perform this function with case sensitivity, (so that "soeur" becomes "sur" and "Soeur" becomes "Sur")?
Thanks!