ansible/ansible — pull request #9310 by mesk41in (2014-10-10 19:04:21+00:00)
Title: Fixed hostname matching with pattern having '~' at the beginning

**Issue Type:**
Bugfix Pull Request

**Ansible Version:**
* ansible 1.7.1
* ansible 1.7.2

**Environment:**
Fedora release 20 (Heisenbug)

**Summary:**
After using match() instead of search() for pattern matching ansible doesn't match hostnames with pattern that started with '~'.

**Steps to reproduce**:
```
$ cat inventory
foo
bar
foobar
barfoo
```

**Expected Results:**
```
$ ansible '~bar' -i inventory --list-hosts
bar
foobar
barfoo
```

**Actual Results:**
```
$ ansible '~bar' -i inventory --list-hosts
bar
barfoo
```