[Solved] Replacing a letter inside a word

Discuss the word processor
Post Reply
clausisme
Posts: 24
Joined: Fri Mar 28, 2014 3:23 pm

[Solved] Replacing a letter inside a word

Post by clausisme »

Some time ago there was a grammatical change in the way some words are written in romanian. Here is one of these rules:
- when inside a word î turns into â like: cît > cât. But only when inside a word, this does not apply when it's at the beginning or at the end of the word like this: încît > încât.

I have some old books and I need to use a replace command in writer.
Last edited by clausisme on Tue Jan 23, 2018 9:29 am, edited 2 times in total.
OpenOffice 4.01 on Windows 7
User avatar
acknak
Moderator
Posts: 22756
Joined: Mon Oct 08, 2007 1:25 am
Location: USA:NJ:E3

Re: Replacing a letter inside a word

Post by acknak »

This works for me with your example:

Edit > Find & Replace
Search for: (?<=\w)î(?=\w)
Replace with: â
Options/Regular expressions: ON

Click Replace All

The patterns around the î are "lookbehind" and "lookahead" elements that require a "word" character, \w, before and after the letter, but they don't include the word characters in the actual match, so they are not replaced.

These pattern elements are explained here (for example):
https://www.regular-expressions.info/lookaround.html
AOO4/LO5 • Linux • Fedora 23
clausisme
Posts: 24
Joined: Fri Mar 28, 2014 3:23 pm

Re: Replacing a letter inside a word

Post by clausisme »

Thank you. That worked.
OpenOffice 4.01 on Windows 7
Post Reply