Page 1 of 1
Regular expressions in PSPAD
Posted: 21 Nov 2016 13:07
by RogerF
Sorry, not a FH question, but related.
I want to edit my GEDCOM using PSPAD. I'm looking for a multi-line string, of the form
Code: Select all
1 CHR
2 DATE 7 JUN 1840
2 PLAC Wallingford, BRK
From my recollection of regular expressions, the regex
Code: Select all
1 CHR\n2 DATE .*\n2 PLAC Wallingford, BRK
should work, but I can't persuade PSPAD to accept it, or indeed any variant that I can think of. Any PSPAD experts know what's wrong? Thanks
Re: Regular expressions in PSPAD
Posted: 21 Nov 2016 13:16
by Jane
PSPad does not play well with multiline entries out of the box.
See this extension which Mike posted to the Knowledge Base
fhugdownloads:contents:pspad_phreplace|phReplace
Re: Regular expressions in PSPAD
Posted: 21 Nov 2016 13:23
by tatewise
Depending on exactly what you want to edit, the Search and Replace Plugin may do the job more easily.
Re: Regular expressions in PSPAD
Posted: 21 Nov 2016 14:26
by RogerF
Thank you both. The phdesign URL has changed to
http://phdesign.com.au/phreplace/ but, after following the instructions there, I still can't get it to work. I have S & R; I'll see if it can do what I want. Thanks again.
Re: Regular expressions in PSPAD
Posted: 21 Nov 2016 14:51
by Valkrider
Doesn't Notepad++ do multi-line search and replace too?
Re: Regular expressions in PSPAD
Posted: 21 Nov 2016 15:16
by jbtapscott
Yes - I've just used it to insert a new line in a Search & Replace action.
Re: Regular expressions in PSPAD
Posted: 21 Nov 2016 15:22
by tatewise
Roger, thank you for the updated URL to the DLL.
I have updated the fhugdownloads:contents:pspad_phreplace|> Utility ~ PSPad phReplace Multiline Search and Replace advice and made adjustments for Windows 10. The DLL version number has not changed and all the download files are exactly the same so should still install as before. You did extract the .zip file contents using right-click Extract All?
Where exactly did the installation process breakdown, because there are several workaround steps?
(Interestingly, despite going through a Windows 7 to Windows 10 free upgrade, the PSPad phreplace multi-line feature is still working OK.)
Re: Regular expressions in PSPAD
Posted: 22 Nov 2016 07:47
by RogerF
Mike, I extracted the files and placed them where stated. But thereafter, the Scripts entry on the menubar, which had previously listed three or so scripts, now merely offered Recompile scripts. Clicking on that had no effect.
UPDATE: I uninstalled then reinstalled PSPAD, added the regex files... and it worked. Thanks again.