jaytea commented on a Page, Caps Lock  -  Dec 21, 2010

with the 'S' modifier, all that occurs is mIRC will strip control codes (as $strip() does) before passing the text to the regex engine - a side effect of this is that $regml() will return stripped results and $regml().pos will refer to positions in the stripped string. it does not affect the value of $1- in the event.

since the expression '([A-Z])' only matches a single character that is never part of a control code, the only purpose that including the 'S' modifier serves is that the values of $regml().pos will be modified in a manner that is arguably unfavourable (but that's not relevant here :P). so as it stands, /S doesn't change the behaviour of the given example, but there is the implication that control codes should not be considered, which is why i suggested $strip($1-) in place of $1-.

and yes, the lack of a $len() check looks like it was an unfortunate oversight :P although even without the check it serves as an example of a simple method for calculating the percentage of capital letters in a string - it's just a shame that it isn't documented for the benefit of newcomers to coding.

 Respond  
Are you sure you want to unfollow this person?
Are you sure you want to delete this?
Click "Unsubscribe" to stop receiving notices pertaining to this post.
Click "Subscribe" to resume notices pertaining to this post.