Not sure if this should be in here or in the scripts section.
Just wondering if there is there any way to limit highlights for a single character nickname with regex so the highlight only triggers on exact match and exact match followed by a symbol?
Currently using $me with match on message (matching nick/both triggers the highlight when someone with symbols in their nick speaks)
for example:
Z (wanted)
Z: (wanted)
:Z (unwanted)
Preferably using the built in highlighting rather than a standalone script, I don't mind it as it is but it would be nice to remove the 'false' highlights if possible.
Cheers
mIRC currently lacks the possibility to use $identifier with parameters inside the highlight's entry.
You can use $me but $me might very well contain meaningful characters used in regex, which would need to be escaped, this is usually done with a simple $replacecs(), but like I just said you cannot use $replacecs() here so there are no way to use $me correctly with a regex match.
That said, it's quite ok to assume that $me won't contain anything meaningful in regex and according to your three examples, you could try to use /(?:^| ) $+ $me $+ (?:$|[ :])/
mIRC currently lacks the possibility to use $identifier with parameters inside the highlight's entry.
You can use $me but $me might very well contain meaningful characters used in regex, which would need to be escaped, this is usually done with a simple $replacecs(), but like I just said you cannot use $replacecs() here so there are no way to use $me correctly with a regex match.
That said, it's quite ok to assume that $me won't contain anything meaningful in regex and according to your three examples, you could try to use /(?:^| ) $+ $me $+ (?:$|[ :])/
Unfortunately I couldn't get anything to trigger a highlight when using this
What was the value of $me when you tried?
And what was the line sent to test this?
Bah, mIRC needs a way to know it must evaluate the entry, use $(/(?:^| ) $+ $me $+ (?:$|[ :])/)
And what was the line sent to test this?
Bah, mIRC needs a way to know it must evaluate the entry, use $(/(?:^| ) $+ $me $+ (?:$|[ :])/)
As far as I can tell that's working great, is it possible to allow symbols such as ?!,. to trigger the highlight instead of just :
Thanks
Yes, you can add anything between \Q and \E:
$(/(?:^| ) $+ $me $+ (?:$|[\Q :?!\E])/)
Though, like I said, you might quickly end up wanting the behavior of \b, which handles exactly that kind of situation.
Yes, you can add anything between \Q and \E:
$(/(?:^| ) $+ $me $+ (?:$|[\Q :?!\E])/)
Though, like I said, you might quickly end up wanting the behavior of \b, which handles exactly that kind of situation.
This also works great, until a comma is used, which results in no highlights working
Right, you might be familiar with the identifier syntax, where the comma is the character used to seperate arguments:
$identifier(<arg1>,<arg2>,<argN>)
You cannot use a litteral comma as part of an argument, you must escape it for mIRC to see it as part of the argument.
One way to achieve that is to use $chr(44):
$(/(?:^| ) $+ $me $+ (?:$|[\Q $chr(44) $+ :?!\E])/)
Right, you might be familiar with the identifier syntax, where the comma is the character used to seperate arguments:
$identifier(<arg1>,<arg2>,<argN>)
You cannot use a litteral comma as part of an argument, you must escape it for mIRC to see it as part of the argument.
One way to achieve that is to use $chr(44):
$(/(?:^| ) $+ $me $+ (?:$|[\Q $chr(44) $+ :?!\E])/)
That's excellent, thanks a lot for the constant help