Somewhere I read that using LUA patterns for searching allows or is like using regular expressions. In notepad this expression: ^.*\b(mPR|dPR|bPR)\b.*$ obtains correct results, but in the Search and Replace plugin, with the LUA Pattern Mode ticked,Search Only finds nothing. What would be the equivalent in LUA pattern? The desired text strings are mPR, dPR, or bPR, case insensitive.
Ron
* Search and Replace 3.2
Search and Replace 3.2
Ron Krzmarzick~~ FH 7.0.20 TNG 14.0.2 website Roots & Relatives Remembered, Laragon 5.0, Win 11 pro
- tatewise
- Megastar
- Posts: 27087
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Search and Replace 3.2
They are like regular expressions but are NOT regular expressions as explained in Lua Patterns in the Help & Advice pages.
To search for that pattern of three case insensitive letters use [mdbMDB][pP][rR]
The nearest to \b backspace would have to be %c any control character.
( I'm not sure where you would have backspace in any FH Project data. )
Although, somewhere I have read that \b means match whole words, which would be more difficult in Lua Patterns.
So the whole pattern might be ^.*%c([mdbMDB][pP][rR])%c.*$
What exactly are you searching for and what do you want to replace it with?
I presume you want to replace, otherwise why have the capture brackets ( ) or maybe they are not capture brackets?
To search for that pattern of three case insensitive letters use [mdbMDB][pP][rR]
The nearest to \b backspace would have to be %c any control character.
( I'm not sure where you would have backspace in any FH Project data. )
Although, somewhere I have read that \b means match whole words, which would be more difficult in Lua Patterns.
So the whole pattern might be ^.*%c([mdbMDB][pP][rR])%c.*$
What exactly are you searching for and what do you want to replace it with?
I presume you want to replace, otherwise why have the capture brackets ( ) or maybe they are not capture brackets?
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Search and Replace 3.2
Mike,
That didn't work for me, per the snapshot. No results. I am looking for the 3 text strings, 3 letters together each. Is that what the pattern is looking for? Those are actually present in those groups of characters.
The backspaces aren't needed.
That didn't work for me, per the snapshot. No results. I am looking for the 3 text strings, 3 letters together each. Is that what the pattern is looking for? Those are actually present in those groups of characters.
The backspaces aren't needed.
Ron Krzmarzick~~ FH 7.0.20 TNG 14.0.2 website Roots & Relatives Remembered, Laragon 5.0, Win 11 pro
- tatewise
- Megastar
- Posts: 27087
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Search and Replace 3.2
If you want to search for the 3 text strings, 3 letters together, then use [mdbMDB][pP][rR]
That is searching for:
1st character is any one of mdbMDB
2nd character is either of pP
3rd character is either of rR
But with that simple pattern, they may occur within another word.
The ^.* and .*$ are superflous.
That is searching for:
1st character is any one of mdbMDB
2nd character is either of pP
3rd character is either of rR
But with that simple pattern, they may occur within another word.
The ^.* and .*$ are superflous.
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry
Re: Search and Replace 3.2
Thanks Mike,
That worked, with of course a few unintended findings as you suggested might occur. I will review the LUA patterns since different than regular expressions. There were superfluous characters because I had mimicked something I found on a regex site.
Isn't it nearly 1am in the UK? Do you sleep?
That worked, with of course a few unintended findings as you suggested might occur. I will review the LUA patterns since different than regular expressions. There were superfluous characters because I had mimicked something I found on a regex site.
Isn't it nearly 1am in the UK? Do you sleep?
Ron Krzmarzick~~ FH 7.0.20 TNG 14.0.2 website Roots & Relatives Remembered, Laragon 5.0, Win 11 pro
- tatewise
- Megastar
- Posts: 27087
- Joined: 25 May 2010 11:00
- Family Historian: V7
- Location: Torbay, Devon, UK
- Contact:
Re: Search and Replace 3.2
I am a bit of a night owl 
Mike Tate ~ researching the Tate and Scott family history ~ tatewise ancestry