https://www.proz.com/forum/memoq_support/345032-memoq_text_inside_%5B%5D_regexp.html

MemoQ text inside [] regexp
Thread poster: Eugene Petukhov
Eugene Petukhov
Eugene Petukhov
Russian Federation
Local time: 08:04
Jul 13, 2020

I want to convert some text inside [...] into tags, for ex: [XENO:qst qst=86 ] and failed with regexp in Tagger.
Absolutely any symbols into square brackets.
I tried such regexp \[*\] But it`s wrong. Anybody knows right regexp?


 
Jan Truper
Jan Truper  Identity Verified
Germany
Local time: 07:04
Member (2016)
English to German
(\[)(*)(\]) Jul 13, 2020

Try the above.

You can find an explanation here:
https://cybertext.wordpress.com/2011/06/20/word-replace-and-reformat-text-inside-square-brackets-using-wildcards/


 
Eugene Petukhov
Eugene Petukhov
Russian Federation
Local time: 08:04
TOPIC STARTER
... Jul 13, 2020

Tnx, I used such variant \[(.*?)\]

 
Eugene Gulak
Eugene Gulak  Identity Verified
Ukraine
Local time: 08:04
Member (2007)
English to Russian
+ ...
Try this Jul 13, 2020

\[.*?\]

 
Thomas T. Frost
Thomas T. Frost  Identity Verified
Portugal
Local time: 06:04
Danish to English
+ ...
\[[^\]]*\] Jul 13, 2020

\[[^\]]*\] works, but Eugene Gulak's version is simpler and better.

What I don't get is the use of both '?' (zero or one) and '*' (zero or more). '?' would seem redundant after '*', but it doesn't work without it.

It's not very well explained at https://docs.memoq.com/current/en/Places/regex-tagger.html .

Edit: there is indeed a descriptio
... See more
\[[^\]]*\] works, but Eugene Gulak's version is simpler and better.

What I don't get is the use of both '?' (zero or one) and '*' (zero or more). '?' would seem redundant after '*', but it doesn't work without it.

It's not very well explained at https://docs.memoq.com/current/en/Places/regex-tagger.html .

Edit: there is indeed a description for '*?': 'zero or as few repeats as possible'.

[Edited at 2020-07-13 15:44 GMT]
Collapse


 
Stepan Konev
Stepan Konev  Identity Verified
Russian Federation
Local time: 08:04
English to Russian
\[.*\] Jul 13, 2020

Thomas T. Frost wrote:
'?' would seem redundant after '*', but it doesn't work without it.

I tried \[.*\] and it worked well for me.


 
Thomas T. Frost
Thomas T. Frost  Identity Verified
Portugal
Local time: 06:04
Danish to English
+ ...
Only with one tag per segment Jul 13, 2020

Stepan Konev wrote:

Thomas T. Frost wrote:
'?' would seem redundant after '*', but it doesn't work without it.

I tried {what you said above} and it worked well for me.


It only works with one tag per segment.

In a case like this:

[abc] normal text [def]

the whole line is turned into a tag.

[Edited at 2020-07-13 17:54 GMT]


 
Stepan Konev
Stepan Konev  Identity Verified
Russian Federation
Local time: 08:04
English to Russian
right Jul 13, 2020

Thomas T. Frost wrote:
It only works with one tag per segment.
In a case like this:
[abc] normal text [def]
the whole line is turned into a tag.

Ah, right you are.


 


To report site rules violations or get help, contact a site moderator:


You can also contact site staff by submitting a support request »

MemoQ text inside [] regexp






Trados Business Manager Lite
Create customer quotes and invoices from within Trados Studio

Trados Business Manager Lite helps to simplify and speed up some of the daily tasks, such as invoicing and reporting, associated with running your freelance translation business.

More info »
Protemos translation business management system
Create your account in minutes, and start working! 3-month trial for agencies, and free for freelancers!

The system lets you keep client/vendor database, with contacts and rates, manage projects and assign jobs to vendors, issue invoices, track payments, store and manage project files, generate business reports on turnover profit per client/manager etc.

More info »