Skype's Crazy Regex Easter Egg

Today I was chatting with a colleague on Skype, and as is often the case, misspelled something in my rush to get something across.

A habit I picked up in the IRC days, days I realize have not ended for some, is to use the Perl syntax for doing a regex substitution to indicate a correction.  For example, if you wrote "hello wrld", I would indicate my correction using "s/wrld/world/".  Crazily enough, this now works in Skype.  It just edits your previous post inline!

Some experimentation shows that it isn't a full regular expression engine, it will only do straight word substitution.  It also assumes the 'g' or 'global' flag, so all words that match your string will be replaced, not just the first.

But it is super cool stuff, a brief demonstration:

Noticed how I mispelled word as wrd.  No worries, I can edit that post with the regex:

Hats off to Skype on this one, neat stuff.

Update: I forgot that there's also another IRC'ism that Skype supports.  /me.  You can type "/me is bored" and Skype will turn this into "Nic Pottier is bored" in a specially formatted block.  Anybody know any others?

26 responses
From this comment I just checked and Adium (the Mac OS X chat client I use when I am not using emacs' jabber mode) has an add-on that allows you to use PCRE syntax, too. Hats off for Skype for doing this straight (and to you for posting it), though.



I remember when I was chatting with a friend a while ago, I have the s/x/y/ habbit from IRC. I was on Linux with a dark color scheme, and I couldn't figure out what a sword was next to one of my chat lines. Only later I found out that it was actually a pen telling me that I've edited that line. The pen looks weird on a dark background :)
Ya, some searching did bring up that it has been around for a while. (though not on Windows?) But it was new to me, and just tickled my fancy, ergo the post.
That is just awesome!

Reminds me of how Google likes Vim shortcuts :-)

It isn't actually from perl, it is much much older s/string/replacement/g is the search and replace used in the unix SED editor (1973), and the pneumonic is 's'earch for 'string' and replace with 'replacement' 'g'lobally. This was incorporated by AWK; which perl was written to replace, and thus was backward compatible with.

Ah, excellent, I suspected it was older than Perl, that's just where I picked up the habit.  Thanks for the clarification.
Or you can just press up on the keyboard and edit your previous line
@dustinecu yes. You could also shave with a sheet of paper. Not as much fun, is it?
@Horia Dragomir touche
try this: /test
i'm using skype 5.1 on win 7 machine - is it possible that s/string/replacement doesn't work... or is it just me? /test ( and /me work as expected
There's a boatload of these in the book "Skype: The Definitive Guide"
You can get a full list of available commands using /admin


I lied. /admin gives you a partial list — is the full list.
@larryshertz: does not work for me under skype 5.0 and winXP
This was a great feature, but it seems to have stopped working on Mac Skype as of at least version
This has exactly nothing to do with RegEx. That said, it also seems to have been removed with the most recent upgrade. Which is really a shame, it was my favorite feature.
7 visitors upvoted this post.