flex.rb is a regexp matching and scanning library for the Ruby language. It is more than 3 times faster than Ruby regexps, and supports matching text arriving in multiple parts (via async, non-blocking I/O). flex.rb embeds the GNU Flex 2.5.4 (fast lexical analyzer generator) as an engine, and all of Flex's functionality is accessible from Ruby scripts.