phpoxford / spires-irc

Spires IRC client and mock server.
MIT License
0 stars 4 forks source link

The Augmented BNF for messages converted to regex #14

Open martindilling opened 8 years ago

martindilling commented 8 years ago

Mostly direct translation of the Augmented BNF for an IRC message to a giant regex. It takes a raw IRC message and returns an array with:

`prefix`     // The whole prefix string
`nickname`   // The nickname from the prefix
`username`   // The username from the prefix
`hostname`   // The hostname from the prefix
`servername` // The servername from the prefix
`command`    // The command
`params`     // The parameters

I'm pretty sure this can be optimised quite a lot, but for now it parses following the specification and it works ;)

garethellis36 commented 8 years ago

Nice job!

olorton commented 8 years ago

:+1: