Replace regular space before or after all tags with a non-breaking space - any Regex solutions?
Thread poster: LEXpert
LEXpert
LEXpert  Identity Verified
United States
Local time: 06:41
Member (2008)
Croatian to English
+ ...
Dec 26, 2022

I have a ton of high matches where the only difference from the TM is that parts of each segment are bolded and surrounded by tags, with a non-breaking space added before and after each tag. Surely there must be some way to replace the spaces all at ones?

 
Stepan Konev
Stepan Konev  Identity Verified
Russian Federation
Local time: 14:41
English to Russian
Regex Dec 26, 2022

Find what: [whitespace](<.*?>)
Replace with: [nbsp]$1
To type a nbsp press and hold Alt and type 0160 on the numpad.
Also remember to check the box 'Search within tags'


[Edited at 2022-12-26 22:22 GMT]


 
LEXpert
LEXpert  Identity Verified
United States
Local time: 06:41
Member (2008)
Croatian to English
+ ...
TOPIC STARTER
Works like a charm! Dec 26, 2022

Thank you Stepan! This is exactly what I need.

 


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


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

Replace regular space before or after all tags with a non-breaking space - any Regex solutions?






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 »
TM-Town
Manage your TMs and Terms ... and boost your translation business

Are you ready for something fresh in the industry? TM-Town is a unique new site for you -- the freelance translator -- to store, manage and share translation memories (TMs) and glossaries...and potentially meet new clients on the basis of your prior work.

More info »