Leveraging lookbehind regex to protect text in xml file

I am trying to use a look behind to protect a parameter in an xml file. When I try to add the regex to the embedded content processing, nothing changes for the file filtering. I want to protect the entire parameter value as it is not to be translated and we've run into issues when it is fully exposed. I am looking for ideas for how I can leverage the xml filter while protecting these parameters from translation.

Regex:

(?<=[\n\s>])(\w+?<sub>.+?<\/sub>?)

Example text to be converted to inline placeholder:

t<sub>PLMT</sub>   -->   {1}

Sample xml:

        <section id="SECTION" ishcondition="legacy=filter3">
            <p id="GUID">The period of internal pulse generator
                    (t<sub>PLMT</sub>) is set by the C<sub>PLMT</sub> capacitor. The period,
                    t<sub>PLMT</sub> defines the minimum repetition rate of LED current pulses
                allowed based on external UDIM signal and is set based on the maximum PWM frequency,
                    f<sub>PWM(MAX)</sub>. An additional margin in design is necessary to compensate
                for the component tolerances and noise in the system. The t<sub>PLMT</sub> period is
                determined using <xref href="GUID" />.</p>
		</section>

<section id="SECTION" ishcondition="legacy=filter3">
<p id="GUID">The period of internal pulse generator
(t<sub>PLMT</sub>) is set by the C<sub>PLMT</sub> capacitor. The period,
t<sub>PLMT</sub> defines the minimum repetition rate of LED current pulses
allowed based on external UDIM signal and is set based on the maximum PWM frequency,
f<sub>PWM(MAX)</sub>. An additional margin in design is necessary to compensate
for the component tolerances and noise in the system. The t<sub>PLMT</sub> period is
determined using <xref href="GUID" />.</p>
</section>

emoji
Parents Reply Children
  •  

    I have few more questions from this:

    1. Same as before, when did you make this change to the filetype?  Before you created the project or after?
    2. Your XML file is a DITA 1.3 file?  I ask because you need to make sure that it is being picked up by the correct xml filetype?
    3. Your screenshot don't tell us what parser rule this applies to.  Did you apply the sdl:paragraph structure to the appropriate parser rule (the one governing the placeholder you are trying to protect)?

    You only provided a snippet and whilst it looks as though it could be a DITA file I'd be guessing.

    Paul Filkin | RWS

    Design your own training!
    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub

    emoji