python determine whether to include English characters

Import Re 

# determines whether contain English 
STR = " text text " 
contain_en = BOOL (the re.search ( ' [AZ] ' , STR)) 

IF contain_en:
     Print ( " contains English characters " )
 the else :
     Print ( " do not contain English characters " )

 

Guess you like

Origin www.cnblogs.com/jumpkin1122/p/11516944.html