thierryc / Sketch-Find-And-Replace

Sketch plugin to do a find and replace on text within layers
Apache License 2.0
711 stars 37 forks source link

Replace a single word but not when it's a part of a sentence #126

Open mxdslien opened 2 years ago

mxdslien commented 2 years ago

I'm translating a bunch of text and I have a handful of places saying "Yes" and "No". I want to replace all instances where it only says "No", but avoid replacing "No"'s from other instances where it is a part of a longer sentence.

E.g: Want to translate: No -> Nei Want to avoid: This is no longer available -> This is nei longer available

Is this possible? I tried the "Whole word" option but I might be misunderstanding what that option does.

thierryc commented 11 months ago

Certainly! You can achieve this by utilizing the regex options. It might seem a bit tricky initially, but you can likely figure it out.

Give the https://regex101.com/ a try for testing and refining your regular expression.

thierryc commented 11 months ago

Another good link for regex lovers: https://www.debuggex.com