Regex to identify mismatch between source and target segment in sdlxliff?

Hello,

just now I was struck with an error that happened while splitting/merging segments in a not too small sdlxliff (from an idml file). First of all: Good documentation in the SDL Knowledge base! (https://gateway.sdl.com/apex/communityknowledge?articleName=000004305)

The problem was a mismatch between source and target segment.

Marking the relevant bits I scrolled through the file with Notepad++, found the offending segment and also found that once you apply Pretty Print to the sdlxliff file Strudio won't accept it anymore, so back to the backup file, fix the mismatch (once you know the numbers you don't need Pretty Print anymore), all fine, file works nicely now.

Phew.

Here's my question: Does anyone have a Regex that finds this kind of mismatch between source and target segment? It does take quite some time to find the broken part of the file...

Or is it too much for Regex and one would be better off with a proper parser?

Screenshot of Trados Studio error message indicating a mismatch between source and target segments in an sdlxliff file.

Daniel



Generated Image Alt-Text
[edited by: Trados AI at 4:07 AM (GMT 0) on 5 Mar 2024]
emoji