You are here: PSPad forum > English discussion forum > Re: Search / replace issue

Re: Search / replace issue

#1 Search / replace issue

Posted by: groston | Date: 2022-04-18 19:40 | IP: IP Logged

I created a new text file and pasted about 200 characters into it, including eight semi-colons dispersed throughout. I then hit ctrl-H, so that I could replace the semi-colons with new-lines. When I clicked OK, it says that eight semi-colons have been replaced, but it only replaces the first one. When I changed the new-line to some random text, it does replace all eight instances.

It seems to me that there is something not quite right when the text is being replaced with new-lines...

Options: Reply | Quote | Up ^


#2 Re: Search / replace issue

Posted by: vbr | Date: 2022-04-18 21:19 | IP: IP Logged

groston:
I created a new text file and pasted about 200 characters into it, including eight semi-colons dispersed throughout. I then hit ctrl-H, so that I could replace the semi-colons with new-lines. When I clicked OK, it says that eight semi-colons have been replaced, but it only replaces the first one. When I changed the new-line to some random text, it does replace all eight instances.

It seems to me that there is something not quite right when the text is being replaced with new-lines...

Hi,
unfortunately, there are some limitations or quirks with regard to handling newlines for search and replace.
In this case a workaround can help:
Place the cursor at the end of the file and in the search and replace dialog set the Direction: (.) Backward. The replacement with newlines (\n in regex mode) should then work.

hth
vbr

Options: Reply | Quote | Up ^


#3 Re: Search / replace issue

Posted by: groston | Date: 2022-04-25 03:22 | IP: IP Logged

You are correct, thanks

Options: Reply | Quote | Up ^






Editor PSPad - freeware editor, © 2001 - 2022 Jan Fiala, Hosted by Webhosting TOJEONO.CZ, design by WebDesign PAY & SOFT, code Petr Dvořák, Privacy policy and GDPR