Or is it fixed format?
I'm used to industrial (Code 39, Code 128), and I try to get the customer to always have a CR at the end of the scan (scanner is programmed to add CR at end). Most industrial scanners (and IIRC, some of the retail ones) will let you program start/end characters.
If it's a fixed format such as UPC/EAN, then you should know how many characters.
--Tony