Skype's Crazy Regex Easter Egg
blog.nyaruka.com
blog.nyaruka.com
The s/that/this/ syntax is not, of course, a regular expression. The regular expression is the thing that might go into the "that" part, an expression that can match against several different inputs. If all it supports is literals, it's not really worth calling it a regular expression, in my opinion.
The article expresses this like so:
Some experimentation shows that it isn't a full regular expression engine, it will only do straight word substitution.
I think this is stretching it; sure all literal strings are regular expressions, but if that's all there is (i.e. no alteration, repeat etc), then why call it an RE at all?
Am I just being grumpy?
It is clearly not a regex engine, but it operates like a very very naive one, and uses the Perl syntax for them.
Ultimately Regex just seemed like the easiest / clearest way of describing the functionality. IE, if I say "Skype supports the Perl Regex syntax for simple word substitution" you probably instantly think of s/a/b/.
Maybe I should have used that as the headline, but it seemed a bit long.
Sure, Perl uses that syntax but it was inherited from sed which got it from ed.
I know Perl. It is the Perl syntax for regular expressions. I never said it was the first or only to use that syntax. Sheesh.
http://blog.jgc.org/2011/02/hacking-toshiba-t4800ct-love-sto...
I also noticed recently that, in a somewhat shell-like way, you can press the up arrow to edit your previous message at will (but perhaps this is common knowledge).
guy> I love you darling!
girl> GO 2 HELL!!
guy> s/love/hate
guy> s/darling/bitch
sys: Available commands:
/me [text]
/add [skypename+]
/alertson [text]
/alertsoff
/whois [skypename]
/help
For more help please see http://www.skype.com/go/help.chathelp
Clickable link to the full list: http://www.skype.com/go/help.chathelpI will pay you $1,000 to do this project for me
(at end of chat)
s/$1,000/$1
I believe the change is visible in Skype for all participants.
It is really interesting that nobody points this out ;)
[1]: http://cl.ly/4Z1R