mIRC Home    About    Download    Register    News    Help

Print Thread
#271275 03/02/23 03:57 AM
Joined: Nov 2004
Posts: 833
Jigsy Offline OP
Hoopy frood
OP Offline
Hoopy frood
Joined: Nov 2004
Posts: 833
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,075
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,075
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,075
Hoopy frood
Offline
Hoopy frood
Joined: Jan 2004
Posts: 2,075
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.


Link Copied to Clipboard