Aug-15-2022, 09:50 PM
Greetings!
I'm trying to find strings with a particular word(s).
Here are the words:
BG13TPPVxxxx -- where xxxx are the 4 digits
BG13TPPVxxxx(B or C) -- and the letters "B" or "C" at the end
I got this regex but it is failing, it also picks up words with SPPV.
Like this:
BG13SPPVxxxx
I'm trying to find strings with a particular word(s).
Here are the words:
BG13TPPVxxxx -- where xxxx are the 4 digits
BG13TPPVxxxx(B or C) -- and the letters "B" or "C" at the end
I got this regex but it is failing, it also picks up words with SPPV.
Like this:
BG13SPPVxxxx
if re.search('^[a-zA-Z]{2}\d{2}TPPV\d{4}\.|[b|C]\.',x)Thank you!