mIRC Home    About    Download    Register    News    Help

Print Thread
#230073 23/02/11 08:22 PM
Joined: Feb 2011
Posts: 7
F
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

Joined: Oct 2004
Posts: 8,330
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
Joined: Feb 2011
Posts: 7
F
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...

Joined: Jul 2006
Posts: 4,145
W
Hoopy frood
Offline
Hoopy frood
W
Joined: Jul 2006
Posts: 4,145
You can use regex to do that, the pattern /(?!WindowS)(?i)windows/ will match the string "windows" and all its possibilities but "WindowS"


#mircscripting @ irc.swiftirc.net == the best mIRC help channel
Joined: Feb 2011
Posts: 7
F
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

Joined: Jul 2007
Posts: 1,129
T
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.
Joined: Feb 2011
Posts: 7
F
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Feb 2011
Posts: 7
One more thing, are the "/" necessary?

Joined: Dec 2002
Posts: 2,031
R
Hoopy frood
Offline
Hoopy frood
R
Joined: Dec 2002
Posts: 2,031

Yes, add it exactly as Wims showed you.

Joined: Jul 2007
Posts: 1,129
T
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.

Joined: Nov 2006
Posts: 1,559
H
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.


Joined: Feb 2011
Posts: 7
F
Nutrimatic drinks dispenser
OP Offline
Nutrimatic drinks dispenser
F
Joined: Feb 2011
Posts: 7
Thanks for the answers, you guys are really helpful.


Link Copied to Clipboard