Greg --
OK, thanks. I always assume as much in this forum.
>>I think your attempt works fine in the case where there is at least one non-blank character after the embedded UPC Code. If however, the string is "Small Widget 1 12345 12345 1", it returns spurious results.
>
>>I believe this is caused by your looping; lnPos should only try to move to the next non-blank character if there are characters left to be searched for. (i.e., in all cases except the last character)
>
>This was just a quick attempt -- my thought is to find the UPC pattern within the main string, ignoring spaces.
>
>I will leave it to you as an exercise to complete the code for all cases. :)
Jim Nelson
Newbury Park, CA