mIRC Home    About    Download    Register    News    Help

Print Thread
Add highlight exceptions? #230073 23/02/11 08:22 PM
Joined: Feb 2011
Posts: 7
F
file1854 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Feb 2011
Posts: 7
Hey,

I'm using highlights and I'd like to know if there's a way to add exceptions.

Let's say I'm using "windows" as an highlight but I want to exclude "WindowS" case sensitive, is that possible?

Thanks

Re: Add highlight exceptions? [Re: file1854] #230075 23/02/11 09:01 PM
Joined: Oct 2004
Posts: 8,330
Riamus2 Offline
Hoopy frood
Offline
Hoopy frood
Joined: Oct 2004
Posts: 8,330
There is a case sensitive checkbox in the highlight dialog.


Invision Support
#Invision on irc.irchighway.net
Re: Add highlight exceptions? [Re: Riamus2] #230078 23/02/11 09:44 PM
Joined: Feb 2011
Posts: 7
F
file1854 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Feb 2011
Posts: 7
Originally Posted By: Riamus2
There is a case sensitive checkbox in the highlight dialog.

Yes, but how do I exclude "WindowS" from my highlights, while keeping all other possibilities of capitalization? Like Windows, windowS, WINDOWS, etc...

Re: Add highlight exceptions? [Re: file1854] #230080 23/02/11 11:06 PM
Joined: Jul 2006
Posts: 3,723
W
Wims Offline
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 3,723
You can use regex to do that, the pattern /(?!WindowS)(?i)windows/ will match the string "windows" and all its possibilities but "WindowS"


Looking for a good help channel about mIRC? Check #mircscripting @ irc.swiftirc.net
Re: Add highlight exceptions? [Re: Wims] #230081 24/02/11 01:58 AM
Joined: Feb 2011
Posts: 7
F
file1854 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Feb 2011
Posts: 7
Originally Posted By: Wims
You can use regex to do that, the pattern /(?!WindowS)(?i)windows/ will match the string "windows" and all its possibilities but "WindowS"

Thanks a lot, it worked. grin

Re: Add highlight exceptions? [Re: file1854] #230083 24/02/11 08:18 AM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
Wims' regex won't exclude "windowS" though. This one will:/((w|W)indows?)(?!S)/

Never mind. I misread your post.

Last edited by Tomao; 24/02/11 08:24 AM.
Re: Add highlight exceptions? [Re: file1854] #230089 24/02/11 05:21 PM
Joined: Feb 2011
Posts: 7
F
file1854 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Feb 2011
Posts: 7
One more thing, are the "/" necessary?

Re: Add highlight exceptions? [Re: file1854] #230093 24/02/11 05:42 PM
Joined: Dec 2002
Posts: 2,021
R
RoCk Offline
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,021

Yes, add it exactly as Wims showed you.

Re: Add highlight exceptions? [Re: file1854] #230095 24/02/11 06:13 PM
Joined: Jul 2007
Posts: 1,129
T
Tomao Offline
Hoopy frood
Offline
Hoopy frood
T
Joined: Jul 2007
Posts: 1,129
The forward slash in regex is call delimiter, and it should be used to wrap around a pattern. I have seen people do it without it in MSL without a problem, but it can result an error if you don't include it for php. The may as well apply to other scripting languages.

Re: Add highlight exceptions? [Re: Tomao] #230097 24/02/11 06:50 PM
Joined: Nov 2006
Posts: 1,559
H
Horstl Offline
Hoopy frood
Offline
Hoopy frood
H
Joined: Nov 2006
Posts: 1,559
Originally Posted By: Tomao
The forward slash in regex is call delimiter, and it should be used to wrap around a pattern. I have seen people do it without it in MSL without a problem, but it can result an error if you don't include it for php.

Omitting the delimiter in MSL is fine - as long as the the expression you aim for does not start with the "m" char. A leading "m" without delimiter defines the following char as the delimiter. But as long as you want to use the default delimiter "/", you don't have to put that "m".
Code:
$regex(bla,test) == $regex(bla,/test/) == $regex(bla,m/test/) == $regex(bla,m@test@)
but
Code:
$regex(bla,mudbug) == $regex(bla,/db/g)


Imo to always include the delimiter is good scripting habit.


Re: Add highlight exceptions? [Re: file1854] #230098 24/02/11 06:56 PM
Joined: Feb 2011
Posts: 7
F
file1854 Offline OP
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Feb 2011
Posts: 7
Thanks for the answers, you guys are really helpful.