# regex with lineinfile module giving error

**URL:** <https://forum.ansible.com/t/regex-with-lineinfile-module-giving-error/18694>\
**Category:** Ansible Project\
**Created:** [July 6, 2015, 8:34pm UTC](https://forum.ansible.com/t/regex-with-lineinfile-module-giving-error/18694 "2015-07-06T20:34:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jim\_McMahon](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@Jim\_McMahon](https://forum.ansible.com/u/Jim_McMahon)\
**Post date:** [July 6, 2015, 8:34pm UTC](https://forum.ansible.com/t/regex-with-lineinfile-module-giving-error/18694/1 "2015-07-06T20:34:17Z")

</div>

I have version 1.8.2 of ansible, but it’s giving me this error when I try to use regex with lineinfile:

```auto
**msg: unsupported parameter for module: regex**

```

```auto

```

```auto
Here's what I'm trying to run:

```

```auto

```

```auto
- name: Set ASSET_VERSION to commit hash
  sudo: true
  sudo_user: "{{ app_name }}"
  lineinfile: 
    dest: "{{ env_path }}/{{ app_name }}-env.{{ stage }}"
    line: "ASSET_VERSION={{ commit_hash.stdout }}"
    regex: "^ASSET_VERSION="
    state: present
  tags:
    - design

```

```auto

```

```auto
It will run without the regex, but not with the regex. Was regex taken out of lineinfile?

```

---

<div class="post-metadata">

**Author:** ![Brian\_Coca](https://avatars.discourse-cdn.com/v4/letter/b/6de8d8/32.png) [@Brian\_Coca](https://forum.ansible.com/u/Brian_Coca)\
**Post date:** [July 6, 2015, 8:53pm UTC](https://forum.ansible.com/t/regex-with-lineinfile-module-giving-error/18694/2 "2015-07-06T20:53:54Z")

</div>

regexp not regex is the parameter.

---

<div class="post-metadata">

**Author:** ![Jim\_McMahon](https://avatars.discourse-cdn.com/v4/letter/j/e8c25b/32.png) [@Jim\_McMahon](https://forum.ansible.com/u/Jim_McMahon)\
**Post date:** [July 6, 2015, 8:59pm UTC](https://forum.ansible.com/t/regex-with-lineinfile-module-giving-error/18694/3 "2015-07-06T20:59:46Z")

</div>

Ugh!. Thanks
