Issue #26: optimize for cases when regex ends in .*