How to define multi-line opening tag?

I'm trying to create a regex-based file type for a Typescript/Javascript file that contains line-breaks between the id and the translatable text in some of the lines.

For example:

'title': 'This is the title',
'line1': 'This is the first line',
'line2': 'This is the second line',
'loremipsumloremipsumloremipsumloremipsumloremipsumloremipsum':
'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
'line4': 'This is the fourth line',

I've created a new regex-based file type using the following settings:

Trados Studio Document Structure settings showing opening pattern as caret and closing pattern as dollar sign with Multiline checked as True. Edit inline rule dialog in Trados Studio with Rule Type set to Tag pair, opening pattern regex inputted, and closing pattern empty.

Document structure:
^
$
Multiline (yes)

Inline tags: 
(?m) +'[^']+':\s+' 

',

Unfortunately, these settings don't work if the colon that separates the id from the translatable content is followed by a line break:
Preview of a Javascript file in Trados Studio highlighting the issue where a long id is incorrectly extracted as translatable text due to a line break.
How do I need to modify the regex for the opening tag so that very long id is no longer extracted as a translatable string?
(For technical reasons, I can't simply reformat the source file.)



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