mIRC Home    About    Download    Register    News    Help

Print Thread
#271275 03/02/23 03:57 AM
Joined: Nov 2004
Posts: 842
Jigsy Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Nov 2004
Posts: 842
I'm not sure if this fits into bugs or feature requests.

Anyway, when trying to find something in my scripts (an uppercase X), I discovered there isn't a way to search case sensitive.

So a request for a checkbox for being able to:

1. Search the script editor case-sensitive
2. Search the text history of channels/queries/etc. case-sensitive
3. Logs case-sensitive


What do you do at the end of the world? Are you busy? Will you save us?
Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Yes, in many places, mIRC defaults to having a case-insensitive search/match.

Generally, you're not going to get a case-insensitive search/match unless a specific operator or identifier or switch has been created for it. i.e. 'iswmcs' or $istokcs.

Also, the 's' and 'w' switches for $read are case-insensitive, with the only way for a case-insensitive search is using the 'r' regex switch.
Likewise, my script here https://mircscripts.info/?page=project&id=5kLCC can search all scripts/aliases for something, but it uses /filter to search for matches, and the only way that /filter can do a case-insensitive match is when using the -g regex switch. so for your example "/srch -r * X" would find all lines containing a capital X.

A case-sensitive switch for $read and /filter would be useful, because many users are not familiar with regex, and even for those who are, some searches can be more complicated in regex than in wildcard lingo

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Update:

In addition to $read and /filter benefiting from case-sensitive searches, so could other text scanning functions like $fline and $hfind, which currently allow this only with regex patterns which many users are not familiar with and which comes with its own bag of special symbols.

--

For $hfind a 'c' switch could modify the 'nWw' to be case-sensitive matches.

--

For $fline which has a bitmask parameter for the switches, this could be additional bitmasks.

T parameter now:
1 = listbox
2 = regex
New:
4 = non-regex search is literal text
8 = non-regex search is case-sensitive
16 = non-regex search is substring match

Bitmask 4 would allow searching for 'hello?' without also finding 'hello ' and 'hello!' and 'hello.' and 'phellogen'

Bitmask 8 would allow searching for case-sensitive spelling of a word or wildcard without also finding case-insensitive matches

In effect, the missing functionality of operators like

if ($1 == hello?)
if ($1 === hello?)
if (%string iswmcs $1)
if (%string isincs $1)

If $fline used T=2 regex bitmask, either the T=4 bitmask should be ignored or a syntax error. T=8 could either be ignored or could disable the /i flag. Is probably simpler to have T=2 make it ignore T=4/8.

Joined: Jan 2004
Posts: 2,127
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,127
Other than the beta's new choice for case-sensitive search, what other intended changes were there for making the F3 script editor searches be like other applications?

One other thing I've noticed is that it still has the behavior of finishing a search by jumping to line#1 of the original script - it used to do that only if the 'search all files' box were checked, but now it also happens when that box is not checked. To demonstrate, make line 100 of $script(2) be

alias test12345678 noop

Now go to the bottom of $script(3) and use F3 to begin a search for test12345678 without the 'search all files' checked.

In no-beta it dings the speaker, but the cursor stays in the same place. In new-beta, the same ding, but the cursor jumps to line 1 of that script.

--

Now go to the bottom of of $script(3) and check the 'search all files' box.

In no-beta it jumps to the match in the other script and highlights the matched text after closing the F3 box. Pressing F3 again jumps to the top of $script(3) because there are no more matches. In new-beta it does the same highlight except for not closing the F3 window, which I guess is fine. But it also does the same jump to the top of the beginning script.

--

Now go to line 101 and input the same string into the F3 box to start the search again without the 'search all files' checked.

In no-beta, it fails to find any matches in rows 1-100 of the same script, but the cursor remains there at the original row. In new-beta, it also fails to find anything in rows 1-100, but it jumps the cursor to line 1.

--

Now go to line 101 again and create the search again after checking 'search all files'. In no-beta and new-beta, they both jump to the top of the beginning script file without finding any matches in line 1-100 of the beginning scriptfile

--

I can see people not wanting to have the search include lines above the cursor, but it would be great if there's a checkbox to have the search wrap around the current file when 'search all files' is not checked. And it seems that 'search all files' should search all files, instead of searching all files except the lines above the cursor.

--

It would also be great if the F3 search had something web browsers and text editors have, which is a backwards search - at least within the current scriptfile. Without that, the least hassle method of searching for the prior occurrence of a string is to put the search string on the current row, then find a line where you can go high enough so that the first match stops being at your beginning cursor position, and then keep memorizing the matched line-numbers while pressing F3 until it finally reaches your original row.

If it's supposed to have the jump-to-top behavior, it would be great to have a hotkey and menu choice to jump to the $script and $scriptline from where the F3 search was created. That makes it a lot easier to steal code from one of your other aliases, as well as making it easy to find your way back to wherever you were coding when you started the search, in case a mis-typo in a search would ding you up to line 1.


Link Copied to Clipboard