We use the _command_re to find all instances of _item_cmds referencing something that looks like a ticket.
We then use TICKET_RE to find all instances of a ticket.
I should mention this is some of the oldest code in Sprint.ly so it's probably a bit crufty in some places. That being said, it's also pretty well tested and generally picks up what it should and leaves what it shouldn't.