0

How do i select only the files that starts with either CH or OTC

import re

#Check if the string starts with "The" and ends with "Spain":

txt = "ho rain in Spain"
x = re.search("^[The|he]", txt)

if x:
  print("YES! We have a match!")
else:
  print("No match")

This shows result as YES! We have a match , but i want result as "No match"

Wiktor Stribiżew
  • 561,645
  • 34
  • 376
  • 476
Surender Raja
  • 3,377
  • 7
  • 37
  • 68

0 Answers0