Ansible conditionals - Wildcard match string
From Testing Strings:
To match strings against a substring or a regex, use the “match” or “search” filter
In your case:
when: ec2_tag_Name is match("testhost.*")
This works as well.
when: "ec2_tag_Name.startswith('testhost')"
You can combine logical operators as well like and and or