Search does not work with "in selection"
- Author
- Message
-
Offline
- Posts: 282
- Joined: Thu Sep 10, 2015 9:53 am
- Location: Deutschland
Search does not work with "in selection"
Szukaj, nie wczytuje zaznaczonego textu przy aktywnym "w zaznaczeniu"
-
Offline
- Posts: 874
- Joined: Sat Jan 16, 2010 2:03 pm
-
Offline
- Posts: 282
- Joined: Thu Sep 10, 2015 9:53 am
- Location: Deutschland
I want to convert: (Chcę zamienić)
ascii->ascii
Windows->WINDOWS
I replaced it (tu zamieniłem) ascii->ascii
now i want to swap (teraz chcę zamienić) Windows->WINDOWS
1.but to load "WINDOWS" to "what?", I need to change direction in the table
"In the selection" for another example on "From the beginning" and just click on the icon "Replace ..."
and again mark the direction "In selection."
(1.aby wczytać "WINDOWS" do "Co:", muszę w tabeli kierunek zmienić
"W zaznaczeniu" na inne np. na "Od początku" i dopiero kliknąć na ikonę "Zamień..."
i ponownie zaznaczyć kierunek "W zaznaczeniu.")
ascii->ascii
Windows->WINDOWS
I replaced it (tu zamieniłem) ascii->ascii
now i want to swap (teraz chcę zamienić) Windows->WINDOWS
1.but to load "WINDOWS" to "what?", I need to change direction in the table
"In the selection" for another example on "From the beginning" and just click on the icon "Replace ..."
and again mark the direction "In selection."
(1.aby wczytać "WINDOWS" do "Co:", muszę w tabeli kierunek zmienić
"W zaznaczeniu" na inne np. na "Od początku" i dopiero kliknąć na ikonę "Zamień..."
i ponownie zaznaczyć kierunek "W zaznaczeniu.")
-
Offline
- Posts: 874
- Joined: Sat Jan 16, 2010 2:03 pm
1. ascii->ASCII ???sexy96 wrote:I want to convert: (Chcę zamienić)
ascii->ascii
Windows->WINDOWS
You want convert some words in uppercase?
In SearchReplace.js you can to do that in one pass
What: (ascii|Windows)
With: return $1.toUpperCase()
Options:
[*] Regular expressions
[*] Replace with function
Button: Replace all
notes:
a. List all the words in parentheses, separating them with "|" (pipe, vertical bar)
b. The option "Multiline" (on the screenshot) in fact do not need.
2.
You can type, not load.sexy96 wrote:1.but to load "WINDOWS" to "what?", I need to change direction in the table
-
Offline
- Posts: 282
- Joined: Thu Sep 10, 2015 9:53 am
- Location: Deutschland
And when will I want to change the order?
(A gdy będę chciał zmienić kolejność?)
3->1(4x) and 4->2(4x)
It's easier to "mark the ascii" and click on the icon
"Replace ..." in the Toolbar, instead of writing it below
(Nie łatwiej "zaznaczyć ascii" i klinąć na ikonę
"Zamień..." w Toolbar, zamiast wypisywać to poniżej)
What: (ascii|Windows)
With: return $1.toUpperCase()
I do not have:
Replace with function
and
Multiline
I have x86, because I am using: Aspell
(Mam x86, ponieważ używam: Aspell)
(A gdy będę chciał zmienić kolejność?)
3->1(4x) and 4->2(4x)
It's easier to "mark the ascii" and click on the icon
"Replace ..." in the Toolbar, instead of writing it below
(Nie łatwiej "zaznaczyć ascii" i klinąć na ikonę
"Zamień..." w Toolbar, zamiast wypisywać to poniżej)
What: (ascii|Windows)
With: return $1.toUpperCase()
I do not have:
Replace with function
and
Multiline
I have x86, because I am using: Aspell
(Mam x86, ponieważ używam: Aspell)
-
Offline
- Posts: 874
- Joined: Sat Jan 16, 2010 2:03 pm
begin with the end (zacznę od końca)
1.
2.
3.
If you want to do that: "button31=..." -->> "button29=..."
In "SearchReplace.js" you can use some arithmetic (31-2=29, 3-2=1, 4-2=2)
What: (\d+)(=)
With: return $1-2+$2
Options:
[*] Regular expressions
[*] Replace with function
Button: Replace all
notes:
1) In "With:" we take the first reference back and subtract from it two - [$1-2...]. Then "glue" the second reference back - [...+$2].
2) If you have only short (single digits) numbers [0-9], you can use (\d)(=) instead (\d+)(=)
3) We need second group (=) to identify strings like "\SysWOW64\" in text and ignore them.
4.
1.
I'm too. So what?sexy96 wrote:I have x86...
2.
Pay attention to detail! I use in the example standard script "SearchReplace.js" (with Scripts Plugin). See text and screenshot. This script is more powerful than the standard comand "Replace".sexy96 wrote:I do not have:
Replace with function...
3.
sexy96 wrote:3->1(4x) and 4->2(4x)
If you want to do that: "button31=..." -->> "button29=..."
In "SearchReplace.js" you can use some arithmetic (31-2=29, 3-2=1, 4-2=2)
What: (\d+)(=)
With: return $1-2+$2
Options:
[*] Regular expressions
[*] Replace with function
Button: Replace all
notes:
1) In "With:" we take the first reference back and subtract from it two - [$1-2...]. Then "glue" the second reference back - [...+$2].
2) If you have only short (single digits) numbers [0-9], you can use (\d)(=) instead (\d+)(=)
3) We need second group (=) to identify strings like "\SysWOW64\" in text and ignore them.
4.
I do not persuade, but only to inform about the other options.sexy96 wrote:It's easier to "mark the ascii" and click on the icon...
-
Offline
- Posts: 282
- Joined: Thu Sep 10, 2015 9:53 am
- Location: Deutschland
Thanks, interesting proposition.
1.
It works great:
What: (\d+)(=)
With: return $1-2+$2
but it does not work
What: (\d+)(=)
With: return $1+2+$2
2.
"Delete empty lines";
"Delete leading and trailing spaces";
"Zap symbols with spaces";
How to change it to polish?
change here, causes the subtitles to disappear completely
if (nStringID == STRID_TEMPLATE1)
return "Delete empty lines";
if (nStringID == STRID_TEMPLATE2)
return "Delete leading and trailing spaces";
if (nStringID == STRID_TEMPLATE3)
return "Zap symbols with spaces";
1.
It works great:
What: (\d+)(=)
With: return $1-2+$2
but it does not work
What: (\d+)(=)
With: return $1+2+$2
2.
"Delete empty lines";
"Delete leading and trailing spaces";
"Zap symbols with spaces";
How to change it to polish?
change here, causes the subtitles to disappear completely
if (nStringID == STRID_TEMPLATE1)
return "Delete empty lines";
if (nStringID == STRID_TEMPLATE2)
return "Delete leading and trailing spaces";
if (nStringID == STRID_TEMPLATE3)
return "Zap symbols with spaces";
-
Offline
- Posts: 874
- Joined: Sat Jan 16, 2010 2:03 pm
1.
2) JScript operator "-" has only one meaning: operation of subtraction.
But JScript operator "+" has two functions: the operation of addition and string concatenation.
JScript does not know what is our reference back ($1) and uses the "+" sign to mean "concatenation".
To avoid this, we will have to explain JScript that $1 is a number and that we need to do addition:
What: (\d+)(=)
With: return parseInt($1)+2+$2
...and "yes", [ return parseInt($1)-2+$2 ] would work too, but I was too lazy to make a universal solution.
2.
1) Hard and dangerous: You can modify "SearchReplace.ini" (not "SearchReplace.js" !!!)
2) A simple and safe: After any template selection in the same menu will appear additional item "rename...". Select it and replace the text you need.
Repeat this procedure for each of the three templates.
1) "return" is missing on your screenshotsexy96 wrote:but it does not work
What: (\d+)(=)
With: return $1+2+$2
2) JScript operator "-" has only one meaning: operation of subtraction.
But JScript operator "+" has two functions: the operation of addition and string concatenation.
JScript does not know what is our reference back ($1) and uses the "+" sign to mean "concatenation".
To avoid this, we will have to explain JScript that $1 is a number and that we need to do addition:
What: (\d+)(=)
With: return parseInt($1)+2+$2
...and "yes", [ return parseInt($1)-2+$2 ] would work too, but I was too lazy to make a universal solution.
2.
Two ways:sexy96 wrote:How to change it to polish?
1) Hard and dangerous: You can modify "SearchReplace.ini" (not "SearchReplace.js" !!!)
2) A simple and safe: After any template selection in the same menu will appear additional item "rename...". Select it and replace the text you need.
Repeat this procedure for each of the three templates.
-
Offline
- Posts: 282
- Joined: Thu Sep 10, 2015 9:53 am
- Location: Deutschland
Thanks, it's universal
parseInt($1)+2+$2
parseInt($1)-2+$2
parseInt($1)*2+$2
works without "return"
I changed into ini polish, thanks.
1."Zamień..." Call("Scripts::Main", 1, "SearchReplace.js") Icon(13)
2."Zamień..." Call("Scripts::Main", 1, "SearchReplace.js", `-DefButtonID=1019 /*IDC_REPLACEALL_BUTTON*/`) Icon(13)
What is the difference between 1 and 2?
They look and act the same.
and what does "Zap" mean?
return "Zap symbols with spaces";
parseInt($1)+2+$2
parseInt($1)-2+$2
parseInt($1)*2+$2
works without "return"
I changed into ini polish, thanks.
1."Zamień..." Call("Scripts::Main", 1, "SearchReplace.js") Icon(13)
2."Zamień..." Call("Scripts::Main", 1, "SearchReplace.js", `-DefButtonID=1019 /*IDC_REPLACEALL_BUTTON*/`) Icon(13)
What is the difference between 1 and 2?
They look and act the same.
and what does "Zap" mean?
return "Zap symbols with spaces";
-
Offline
- Posts: 874
- Joined: Sat Jan 16, 2010 2:03 pm
1.
2.
Call("Scripts::Main", 1, "SearchReplace.js", `-DefButtonID=1016 /*IDC_FIND_BUTTON*/`) Icon(13)
in other words:
(1) press {ENTER} = press button "Find next"
(2) press {ENTER} = press button "Replace all"
But if you press buttons with the mouse only (not keyboard), then, indeed, there is no difference (for you).
3.
In russian version used verb "заменить" ("replace").
You can see the RegExp in that template. In "What:" we have [^\n] (A negative character set. Matches any character exept "any newline"). In "With:" we have one space character.
Only the hard way?sexy96 wrote:I changed into ini polish, thanks.
2.
Not the same. ("1") is equivalent tosexy96 wrote:What is the difference between 1 and 2?
They look and act the same.
Call("Scripts::Main", 1, "SearchReplace.js", `-DefButtonID=1016 /*IDC_FIND_BUTTON*/`) Icon(13)
in other words:
(1) press {ENTER} = press button "Find next"
(2) press {ENTER} = press button "Replace all"
But if you press buttons with the mouse only (not keyboard), then, indeed, there is no difference (for you).
3.
"Zap" is slang ~ shoot, kill, to erase.sexy96 wrote:and what does "Zap" mean?
In russian version used verb "заменить" ("replace").
You can see the RegExp in that template. In "What:" we have [^\n] (A negative character set. Matches any character exept "any newline"). In "With:" we have one space character.
-
Offline
- Posts: 2
- Joined: Mon Mar 04, 2024 4:26 am
Re: Search does not work with "in selection"
What is mean by- Szukaj, nie wczytuje zaznaczonego textu przy aktywnym "w zaznaczeniu"?