“Some people, when confronted with a problem, think ‘I know, I'll use regular expressions.’ Now they have two problems.”

All I can say is that I'm very happy that I'm writing “Project: Sippy-Cup [1]” in Lua [2]. Lua not only makes text manipulation easy, (heck, most scripting languages like Python [3] or Ruby [4] can easily manipulate text) but also that it has the wonderful LPeg [5] that makes writing parsers not only easy, but easier to understand, unlike regular expressions (Perhaps it's a bit unfair to regular expressions to force them into parsing email addresses, but hey, most hipster wannabe-programmers these days will reach for regular expressions because they're so easy and right there and it'll work about 90% of the time. Bah! The LPeg code I wrote is perhaps a dozen lines, and that's including comments—it's pretty much the BNF lifted right out of the email address specification and not a wall of text where every other character is a backslash.) [6].

And processing SIP (Session Initiation Protocol) messages is pretty much nothing but text parsing and manipulation, with a little bit of networking on the side.

[1] /boston/2014/03/05.1

[2] http://www.lua.org/

[3] https://www.python.org/

[4] https://www.ruby-lang.org/

[5] http://www.inf.puc-rio.br/~roberto/lpeg/

[6] http://ex-parrot.com/~pdw/Mail-RFC822-Address.html

Gemini Mention this post

Contact the author