
Skype's Crazy Regex Easter Egg - nicpottier
http://blog.nyaruka.com/skypes-crazy-regex-easter-egg
======
unwind
I find it highly annoying that this, as far as I understand, really doesn't
use regular expressions.

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?

~~~
nicpottier
Oh, no argument there, though being "highly annoyed" may point to some
grumpiness.

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.

~~~
zeugma
Historicaly it is more a sed like syntax..

~~~
Dylan16807
And 'sed' is even easier to say than 'perl regex'!

------
gmac
I was sceptical about this, but it works.

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).

~~~
borism
yup, just some toying around by our mac devs :)

~~~
derefr
As a suggestion, you could search the line for the substring with the least
Levenshtein distance from the correction, to use as the text to replace—and
thus also support the "*word" correction syntax I see quite more often from
non-technical friends. :)

~~~
robgough
I believe (though am likely wrong) that the *correction format originated in
IRC, where you can't edit text once you've sent it... though I now see
s/wrd/word/ quite often too - but that's mainly in technical rooms.

------
tmachinecharmer
_Valentines day special_

guy> I love you darling!

girl> GO 2 HELL!!

guy> s/love/hate

guy> s/darling/bitch

~~~
limmeau
Last time I tried, I could only edit my posts while the other one hadn't
answered yet. So: haha, but no.

~~~
AdamGibbins
You can right click any message in your history and hit edit.

~~~
kalmi10
Not on Windows...

------
brown9-2
You can type in "/help" in a chat to see more options:

    
    
        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.chathelp>

------
EGreg
So how do I write the literal version now? I still want it for humorous
effect.

~~~
rflrob
Just leave off the trailing slash. Once someone pointed out that the sed
syntax works for replacing, I started doing that.

------
ck2
So how does it look in your logs?

 _I will pay you $1,000 to do this project for me_

(at end of chat)

 _s/$1,000/$1_

------
roryokane
When I first found this feature, I tried to write an email to Skype to thank
them for including it. Sadly, there is no way to do such a thing. I looked all
over their website for a contact email address, and I finally found one on a
hard-to-find page, but when I wrote my message to it, I just got an auto-reply
saying basically “please don’t send email to us. Call us or open a support
ticket.” Opening a support ticket just to say “thank you” didn’t seem right.
It’s sad that the company provides a way for people to complain about the
program not working, but not for people to thank the makers of the program.
(And I don’t think it’s because thank yous are useless to the company –
knowing what your customers like is valuable feedback.)

------
lemonad
That feature has been around since 2008, iirc.

------
adam-_-
This has worked for as long as I can remember.

------
tacoe
How is this an easter egg? Been using it for years.

~~~
roryokane
It’s an easter egg in that there is no documentation for the feature, and it
is one that only people who are “in on the joke” (use IRC) would look for. The
feature being functional doesn’t prevent it from being an easter egg.

------
kilian
Doesn't work in the linux version :( Skype, can we have an update with new
functionality? (the interface is fine!)

~~~
mziulu
Mmh, I noticed it works with my Skype client, on Fedora, while it doesn't work
wth my buddy's client, on Windows.

~~~
statictype
Works on Windows. At least it did a few months ago when I first discovered it.

------
s0urceror
I've always wanted to implement this in my IRC client, but been too lazy, it's
nice to see it implemented in some form of chat client, although it's a bit
lacking. Is the change visible for all participants?

~~~
piaskal
You can edit sent messages on IRC?

~~~
moe
No, but some clients such as linkinus will apply the regex on the client-side.
Less capable clients just display it like any other message.

------
cgart
You do not need to type in /s/blah/anotherblah, it is already enough that you
just hit the 'Up'-key on your keyboard. You then can edit previously written
text!!!

It is really interesting that nobody points this out ;)

------
sygma
You can also right click on a reply and click "edit message" [1] – tested on
Skype for OS X.

[1]: <http://cl.ly/4Z1R>

~~~
Wawl
You can also press the upper arrow to edit the last message (on mac)

------
nketas
This doesn't work on windows version of skype.. i guess windows users have to
pay for not having regex :P

~~~
nketas
Now a good question would be, will it work if I had Regex for windows
installed when installing skype or what is its windows replacement..!!

------
stuaxo
Cool so whats the regex to erase all the previous comments?

------
kayoone
s/Bit/But

~~~
nicpottier
Thanks. :)

------
aaronsw
/topic works as well.

------
hackermom
words* <\- I just saved a few bytes worth of network traffic, and _a whole
lot_ of CPU cycles.

~~~
T-hawk
At the cost of mental cycles of your recipient reader to parse what just
happened, which come in much less available quantity than network bytes or CPU
cycles.

