MemoQ text inside [] regexp
Autor vlákna: Eugene Petukhov

Eugene Petukhov
Ruská federace
Local time: 17:53
Jul 13

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  Identity Verified
Německo
Local time: 16:53
Člen (2016)
angličtina -> němčina
(\[)(*)(\]) Jul 13

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
Ruská federace
Local time: 17:53
AUTOR TÉMATU
... Jul 13

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

 

Eugene Gulak  Identity Verified
Ukrajina
Local time: 17:53
Člen (2007)
angličtina -> ruština
+ ...
Try this Jul 13

\[.*?\]

 

Thomas T. Frost  Identity Verified
Člen (2014)
dánština -> angličtina
+ ...
\[[^\]]*\] Jul 13

\[[^\]]*\] 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  Identity Verified
Ruská federace
Local time: 17:53
angličtina -> ruština
\[.*\] Jul 13

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  Identity Verified
Člen (2014)
dánština -> angličtina
+ ...
Only with one tag per segment Jul 13

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  Identity Verified
Ruská federace
Local time: 17:53
angličtina -> ruština
right Jul 13

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

Advanced search






SDL Trados Studio 2021 Freelance
The leading translation software used by over 270,000 translators.

SDL Trados Studio 2021 has evolved to bring translators a brand new experience. Designed with user experience at its core, Studio 2021 transforms how new users get up and running and helps experienced users make the most of the powerful features.

More info »
CafeTran Espresso
You've never met a CAT tool this clever!

Translate faster & easier, using a sophisticated CAT tool built by a translator / developer. Accept jobs from clients who use SDL Trados, MemoQ, Wordfast & major CAT tools. Download and start using CafeTran Espresso -- for free

More info »



Forums
  • All of ProZ.com
  • Vyhledávání termínů
  • Zakázky
  • Fóra
  • Multiple search