jojo:
--------------------------------------------------------------------------------
Given the following text: "a | b | c | d"
Search for: \|
Replace by: 
|

In the latest stable version, around 16000 newlines are inserted after "a" until
PSPad gives up and tells me the regex is not formatted correctly.
In the latest development version, I can observe two behaviours. Either the
replaced document looks like this:
"a 
| b | c | d"
PSPad tells me that the expression was replaced three times, although obviously
it was only replaced once.

Or, if it search for "|" instead of "\|", I get:
"  
|
|
|
|
|
|
|
|
|
|
|
|
|
|a | b | c | d"
PSPad tells me the expression was replaced 14 times.

All three behaviours obviously do not deliver the expected outcome, which is:
"a
| b
| c
| d"
--------------------------------------------------------------------------------


Hi,
handling newlines in search and replace functions is indeed a bit restricted and
sometimes unintuitive in PSPad, but in this case a workaround can be used: If
you place the cursor at the end of the text and set the search direction
backward (in the respective dialog), your original pattern works:
Search for: \|
Replace by: 
|

the result is:

a 
| b 
| c 
| d

hth,
  vbr

-- 
<https://forum.pspad.com/read.php?4,69787,69788>
PSPad freeware editor https://www.pspad.com

Odpovedet emailem