You are here: PSPad forum > Developer forum - new builds > PSPad unicode 5.0.7 (625) English

PSPad unicode 5.0.7 (625) English

Goto Page: Previous1 2 3 4 Next

#21 Re: PSPad unicode 5.0.7 (625) English

Posted by: pspad | Date: 2021-05-13 13:58 | IP: IP Logged

tmpad:
Regular expression search & replace is broken in 625.
Searching for beginning of line with circumflex "^" finds nothing. Always reports "no occurences found".

I can't confirm. Problem will be in search expression, not in the "^" char.
Please provide some example what shows nonfunctional search.

Options: Reply | Quote | Up ^


#22 Re: PSPad unicode 5.0.7 (625) English

Posted by: tmpad | Date: 2021-05-13 15:21 | IP: IP Logged

I want to precede each line of a text file with a "{":
Search: ^
Replace: {

The message is 'Next occurence of "^" not found'
Tested Forward, Backward and Entire Scope search. Nothing works.
The same happens when I try to append a closing brace "}" at the end of each line:

Search: $
Replace: }

Options: Reply | Quote | Up ^


#23 Re: PSPad unicode 5.0.7 (625) English

Posted by: pspad | Date: 2021-05-13 15:38 | IP: IP Logged

Hello

But ^ or $ doesn't represent anything, it's only modificatorthat you want to start search on the begin or your expression must be on the end of line.

For your case much better will be to use Insert text to lines (Alt+I) function
You can do your job in one step and put {} around your text

If you want to use regular expressions, do:
search (.*)
replace: {$1}

Options: Reply | Quote | Up ^


#24 Re: PSPad unicode 5.0.7 (625) English

Posted by: tmpad | Date: 2021-05-13 15:57 | IP: IP Logged

Using ^/$ for begin/end of line has worked that way since I started using PSPad.
To be on the save side I tested it with portable version 5.0.6 (589) and it behaves as expected. Perhaps the new editor component?

Options: Reply | Quote | Up ^


#25 Re: PSPad unicode 5.0.7 (625) English

Posted by: pspad | Date: 2021-05-13 16:35 | IP: IP Logged

I never used it this way. But new editor component can be a reason.
Insert text to lines (Alt+I) from menu Edit/Lines manipulation fits much better your needs in this case.

Options: Reply | Quote | Up ^


#26 Re: PSPad unicode 5.0.7 (625) English

Posted by: tmpad | Date: 2021-05-13 18:48 | IP: IP Logged

pspad:
...
But ^ or $ doesn't represent anything, it's only modificatorthat you want to start search on the begin or your expression must be on the end of line.
...

That is not correct. ^ and $ match the starting and ending position of a line. They can be replaced but, because they are logical objects, they can not be deleted (The King is dead, long live the King).

I was not aware of the "Insert Text into Lines..." dialogue. Especially after you introduced search profiles, the search/replace dialogue is more convenient.
The functionality of the "Insert Text into Lines..." dialogue can be done with REs:

Search: (^)(.*)($)
Replace: {$2}

This still works in the 5.0.7 (625), but blank lines are missed out!

I consider the current behaviour an error in handling regular expressions.

Options: Reply | Quote | Up ^


#27 Re: PSPad unicode 5.0.7 (625) English

Posted by: pspad | Date: 2021-05-13 18:58 | IP: IP Logged

To fix it I need to find differences between old and new editor component. Many files with thousands of lines.

Options: Reply | Quote | Up ^


#28 Re: PSPad unicode 5.0.7 (625) English

Posted by: gwinkless | Date: 2021-05-14 14:21 | IP: IP Logged

pspad:
To fix it I need to find differences between old and new editor component. Many files with thousands of lines.

I'd be up for taking a look at this, if you wouldn't object. Which version of synedit are you using now? The one from svn.freepascal.org ? Or a different fork?

Options: Reply | Quote | Up ^


#29 Re: PSPad unicode 5.0.7 (625) English

Posted by: pspad | Date: 2021-05-14 14:32 | IP: IP Logged

Just now this one:
github.com

But I have still own modifications, mostly extending functionality. I am continuously preparing and commiting them.

Options: Reply | Quote | Up ^


#30 Re: PSPad unicode 5.0.7 (625) English

Posted by: gwinkless | Date: 2021-05-14 16:38 | IP: IP Logged

pspad:
Just now this one:
github.com

But I have still own modifications, mostly extending functionality. I am continuously preparing and commiting them.

At first glance, it looks like the options passed to Regex always include the roNotEmpty flag, which would explicitly disallow zero-length matches like only-anchors (^ or $).

Options: Reply | Quote | Up ^


Goto Page: Previous1 2 3 4 Next





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