Just to bikeshed a little bit, `matches` might be better written as `=~'. Maybe that implies regex to too many people, but it's a not uncommon operator in the spirit of `matches`. Lua has `#` as a length operator, so I mention it here in case you want to replace the pipe (`|`) with it.