There’s also match which starts matching from the beginning of the string (search matches anywhere in the string unless you provide it with a regex directive to start at the beginning). It can provide fine-grained control when selecting/rejecting entities.
For example, this will not reject sensor.foo_tesla_door_lock because its object_id begins with foo_ as opposed to tesla_.
The ^ symbol means the following string must appear at the beginning.
Note that because it’s using object_id, instead of entity_id, it is acting on a broader range of entity domains (sensor, binary_sensor, lock, climate, etc).