Esrap is a PEG parser. PEG is Lex and Yacc combined. I'm sure that you could use esrap as a lexer-only, if you wish to.
http://nikodemus.github.io/esrap/
On my github there's an experimental PEG syntax overlaid over esrap syntax, if you care. https://github.com/guitarvydas
Ping me if you need ref's to papers about PEG.
pt