notepad++ replace regex for private Bible module

Share your favorite tips, workarounds and shortcuts for theWord
krzysztofglinka
Posts: 4
Joined: Sat Oct 03, 2020 7:28 pm

notepad++ replace regex for private Bible module

Post by krzysztofglinka »

I am working on my private Bible module in Polish.
I did full 31102 lines file :)
Plain text without any references etc

Now I want to add strong codes to words.
Started with word "Jesus"
In Polish little complex ;) language we have variation of started "Jezus" and many suffixes: Jezusa, Jezusowi, Jezusie etc

How to use "Replace" option in Notepad++ (I use most of time) to append Strong code <WG2424> after any form of Jezus* word?
Can You help me?
krzysztofglinka
Posts: 4
Joined: Sat Oct 03, 2020 7:28 pm

Re: notepad++ replace regex for private Bible module

Post by krzysztofglinka »

I found:
find: \bJezus\w*\K
replace with: <WG2424>

Jezus<WG2424>
Jezusa<WG2424>
Jezusowi<WG2424>
Jezusem<WG2424>
User avatar
jonathangkoehn
Posts: 1253
Joined: Wed Sep 29, 2010 11:04 pm
Location: Colorado, United States
Contact:

Re: notepad++ replace regex for private Bible module

Post by jonathangkoehn »

Greetings Krzystofglinka,
Please refer to Notepad++ help forum for help with their product. (It does look like you are getting there though.)
I would suggestion
Regex:
find: (\bJezus\w*\K)
replace: $1<WG2424>

Perhaps this is what you are already doing?

OOps please don't use ( ) $1 with \K my bad.
Jonathan Koehn @ https://www.thewordbooks.com
TotheWord make resources for theWord
2 Timothy 2:15 “Make every effort to present yourself before God as a proven worker who does not need to be ashamed, teaching the message of truth accurately.” NET2
User avatar
JG
Posts: 4599
Joined: Wed Jun 04, 2008 8:34 pm

Re: notepad++ replace regex for private Bible module

Post by JG »

With the \K there is no need to have any back refs, the match up to that point does not get replaced.

However something like
\bJezus\w*\b\K(?!<W[HG])
should stop accidentally putting duplicate tags
Jon
the
Word 6 Bible Software
OS for testing; Windows 10
Beta Download ------Beta Setup Guide------On-line Manual------Tech doc's and Utilities------Copyright Factsheet
smiths89
Posts: 8
Joined: Wed Mar 15, 2023 9:52 am

Re: notepad++ replace regex for private Bible module

Post by smiths89 »

Absolutely, here's a simpler set of instructions:

Open "Replace" with Ctrl + H.
Type \bJezus(?:a|owi|ie|em|u)?\b in "Find what."
Put Jezus<WG2424> in "Replace with."
Check "Regular expression."
Click "Replace All."
This will tag <WG2424> after "Jezus" and its common suffixes. Test on a small part to be sure.
Post Reply