You are here: PSPad forum > English discussion forum > Multi-Line Search Add-On

Multi-Line Search Add-On

Goto Page: Previous1 2 3 4 5 6 7 8 9 10 11 ...LastNext

#41 Re: Multi-Line Search Testers Needed

Posted by: MrSpock | Date: 2006-12-06 00:35 | IP: IP Logged

[off topic]
Welcome back, Paul!
I was afraid that we might have lost you, because of our incompetent remarks about your program. winking smiley

Options: Reply | Quote | Up ^


#42 Re: Multi-Line Search Testers Needed

Posted by: dash | Date: 2006-12-06 01:08 | IP: IP Logged

Thanks for the reply, phdesigner.

I guess i wasnt very clear with the description, sorry >.<'
Ill try that again:
The new option should do a separate search for each line of "Search text:" field.

Flowchart should go like:
Search the document for string at the line1 of "Search text:" field.
If found, replace it with sting from line1 of "Replace with:" field.
Search the document for string at the line2 of "Search text:" field.
If found, replace it with sting from line2 of "Replace with:" field.

etc. till the last used line.
Its the same as doing the standard Search&Replace action multiple times, only here you could do that just with one click on the button ^^.

Example, the setup ive used in that picture:
img295.imageshack.us
String in document Before -> string in document After replacement:
-------------------------------------------------------
Balck -> White
Moon->Sun
Rotten bananas->Taste awful
I hope now you can unterstand what i was meaning in my last post^^'

p.s.
Another idea which i had, was to implement "Template feature" for your search&replace dialog.
Example:
After you filled in the "Search text:" and "Replace with:" fields with strings, you could save the whole setup (including checked options) as a temple for future use.
(under some name, just the way PSPad lets you save and load macros)

Options: Reply | Quote | Up ^


#43 Re: Multi-Line Search Testers Needed

Posted by: Stefan | Date: 2006-12-26 16:12 | IP: IP Logged

Hi phdesigner,
i have edit your first post to actualizes the download link
and make it more "clearly-presented".

You can and should edit your first post in this threat on your own!

Keep this first post as info point for the latest version number and like
so people can see at easy if there is any new release.

I allowed my self to help you a little bit there, hope you forgives me sad smiley
br
stefan

--
Stefan (pleased user since 1722)
Do you know you can spend Jan a beer? (click here)
Inofficial FAQs + Infos + Special Settings

Edited 1 time(s). Last edit at 2006-12-26 16:12 by Stefan.

Options: Reply | Quote | Up ^


#44 Re: Multi-Line Search Testers Needed

Posted by: Lolo irie | Date: 2007-01-09 11:04 | IP: IP Logged

Beautiful !!!!!!

Very nice addon, but like CarlosCM, I only hope it's possible to add an option to search in fileS winking smiley
It will help a lot for big projects.

Options: Reply | Quote | Up ^


#45 Re: Multi-Line Search Testers Needed

Posted by: garny | Date: 2007-01-13 16:24 | IP: IP Logged

Well I did a very simple test of multiple lines. How the hell are you finding empty lines with this or the default search tool using regular expressions?

I guess it is my mistake, because it is too simple to be overlooked

Options: Reply | Quote | Up ^


#46 Re: Multi-Line Search Testers Needed

Posted by: phdesigner | Date: 2007-01-22 05:18 | IP: IP Logged

Hi All,

New Version 1.2.21 released at www.phdesign.com.au.
The main change is that you can now perform a regular search and then replace it (the replace wasn't working previously).

Thanks Stefan for fixing up my first post, I don't seem to be able to edit it? The only options I have on it are reply, quote and follow thread.

garny, If you just want to find an empty line with phReplace, just put two line feeds (or carriage returns, whatever) in the search field. E.g.
<enter>
<enter>

Options: Reply | Quote | Up ^


#47 Re: Multi-Line Search Testers Needed

Posted by: vbr | Date: 2007-01-22 09:08 | IP: IP Logged

Hi,
many thanks for the new update! The enhanced regular expression support is very usefull.

Maybe one more feature wish - Could also the parentised backreferences be used by RE replace?

Or am I missing something in the RE syntax in VB?
e.g.: searching for (.)\1 works as expected (i.e. it finds "aa", "ee", "--" etc.

but replacing say (.) with -$1- or -\1- doesn't - it inserts the literals -$1- -\1- instead of the content of parens: "abc" >> "-a--b--c-".

Keep up the promissing development!

Options: Reply | Quote | Up ^


#48 Re: Multi-Line Search Testers Needed

Posted by: phdesigner | Date: 2007-01-30 04:07 | IP: IP Logged

Version 1.3.7 Released

Major changes include:
- You can now leave phReplace open while opening, closing or switching files in PSPad.

- Replace all runs Heaps quicker and can be undone in just one undo step.

- Regular Expressions runs in multiline mode. This means that Joe Belmaati's problem searching with ^(\d{4})(.*) now works (see previous posts).

- When searching for new lines with RE the first character of the new line is no longer highlighted.

Also note that to search / replace new lines in regular expressions you may need to use \n\r (or the other way around, I forget).

vbr, As I'm not experienced with RE, I'm not sure what the problem is with your backreference. Can you give me an example search and example text to search so I can see the problem? You talked about

Quote:
replacing say (.) with -$1- or -\1-

but I'm not use if you actually mean the hypens as well, excuse my ignorance.

Options: Reply | Quote | Up ^


#49 Re: Multi-Line Search Testers Needed

Posted by: vbr | Date: 2007-01-30 09:23 | IP: IP Logged

Hi, thanks again for the newest enhanced release!
For some info on backreferences see e.g. www.regular-expressions.info
or the PSPad help: gogogadgetscott.info
(Section: Metacharacters - Backreferences)

Basically, by surrounding an expression with round brackets - the RE engine keeps track of this content.
The simplest way to reference it are numbered backreferences (counting the opening "(" 1,2,... in the expression)

you can use it inside the search string itself (for testing repetition) - this is allready working in phreplace
(.)\1
searches for any character folowed by itself
(.) remembers the content matched by "."
\1 references the content stored in the first bracket pair
thus using (.)\1 you can find aa, ww, 77, -- etc.

another posibility (which is not working yet) is to use these backreferences for replacements.

e.g. you can convert

firstVar = 1;
secondVar = 2;
thirdVar = 3;
...
lastVar = 171;

into:

my_firstVar = 1;
my_secondVar = 2;
my_thirdVar = 3;
...
my_lastVar = 171;

replacing:
([a-z_]*Var = )
with:

my_$1

$1 inserts the matched content of the first bracket pair while replacing - e.g. in .NET, JavaScript, probably VB etc.;
(In Python ... \1 is used for searching as well as replacing backreferences, but it isn't likely to be the case in your script).

I hope this can help a bit, I belive, this functionality would be allready "inside" in the used engine, it could be the problem of (un)escaping the $ or something like that...?

Edited 2 time(s). Last edit at 2007-01-30 09:35 by vbr.

Options: Reply | Quote | Up ^


#50 Re: Multi-Line Search Testers Needed

Posted by: Arthur | Date: 2007-01-30 12:58 | IP: IP Logged

Great new update, thanks!
But changing "Tab Switching" Option have no affect
it still will not switch fields on TAB.

Options: Reply | Quote | Up ^


Goto Page: Previous1 2 3 4 5 6 7 8 9 10 11 ...LastNext





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