Skip to main content
January 9, 2026
Answered

Search and replace by GREP - keeping original letters

  • January 9, 2026
  • 1 reply
  • 197 views

Hi!
I have looked around in the community and found a few topics, which I must admit I did not understand. (I am far from "code wizard"...)
What I want to do is replace one or more characters etc, but keep others. I believe this can be done in GREP, but my attempts have been unsuccessful.
Example:
Search for "(any lowercase letter) (any uppercase letter)" - with a space in the middle.
Change to "(the found lowercase letter)./r(the found uppercase letter)" - thus insert a full stop and a new paragraph instead of the space, but keeping the two letters surrounding it.

a R
becomes
a.
R

Grateful for instructions. 🙏


Correct answer FRIdNGE

Capture d’écran 2026-01-10 à 00.04.05.png

 

(^/)

1 reply

FRIdNGE
January 9, 2026

Find: (\l)\h(\u)

Replace by: $1.\r$2

 

(^/)  The Jedi

January 9, 2026

Thank you, especially for your quick reply.
Unfortunately, I only get the dollar sign, not the letter;

$1.
$2
Either typing "$1" or choosing "found1" - same result.

 

FRIdNGE
FRIdNGECorrect answer
January 9, 2026

Capture d’écran 2026-01-10 à 00.04.05.png

 

(^/)