New implementation using regexes and sockets