This will not work since it fails to take into considering soft clipping. In addition, the sequence may be made up of more than just a match. The match may only cover half the sequence and the tail of the sequence matches reference.