Blender Python select an object with the sequence of letters in a name How can I select the object using a sequence of letters in the name . I know there are operators endswith and starswith, they allocate objects to spell the end or the beginning . But how can I select an object if at the beginning and at the end of the characters are the same, but differ only in the middle of the name.
For example, the operator selects the object name in the end:

for ob in bpy.context.visible_objects:
      if ob.type == 'MESH' and ob.name.endswith("_P678GHNV"):
          obs.add(ob)
          ob.select = True


for example, my naming: 

_Н480_2_ТХ_VALVE1_Linde_Clea
_Н480_3_ТХ_VALVE2_Linde_Clea


And I need to select the objects that include the VALVE in the name
You could also use regular expressions which allow you flexible pattern matching:

import re
import bpy

pattern = re.compile("PREFIX.*POSTFIX") # edit this string

for ob in bpy.context.visible_objects:
    if ob.type != 'MESH':
        continue

    match = pattern.match(ob.name)
    if match == None:
        print("no match for %s"  % ob.name)
    else:
        print("matched %s" % match.group())
        ob.select = True