{"action":"created","issue":{"url":"https://api.github.com/repos/ansible/ansible/issues/8468","labels_url":"https://api.github.com/repos/ansible/ansible/issues/8468/labels{/name}","comments_url":"https://api.github.com/repos/ansible/ansible/issues/8468/comments","events_url":"https://api.github.com/repos/ansible/ansible/issues/8468/events","html_url":"https://github.com/ansible/ansible/pull/8468","id":39602424,"number":8468,"title":"Add regular expression escaping filter.","user":{"login":"renard","id":383821,"avatar_url":"https://avatars.githubusercontent.com/u/383821?v=3","gravatar_id":"","url":"https://api.github.com/users/renard","html_url":"https://github.com/renard","followers_url":"https://api.github.com/users/renard/followers","following_url":"https://api.github.com/users/renard/following{/other_user}","gists_url":"https://api.github.com/users/renard/gists{/gist_id}","starred_url":"https://api.github.com/users/renard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renard/subscriptions","organizations_url":"https://api.github.com/users/renard/orgs","repos_url":"https://api.github.com/users/renard/repos","events_url":"https://api.github.com/users/renard/events{/privacy}","received_events_url":"https://api.github.com/users/renard/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/ansible/ansible/labels/feature_pull_request","name":"feature_pull_request","color":"009800"},{"url":"https://api.github.com/repos/ansible/ansible/labels/P3","name":"P3","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":4,"created_at":"2014-08-06T09:05:38Z","updated_at":"2015-07-26T17:11:31Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/ansible/ansible/pulls/8468","html_url":"https://github.com/ansible/ansible/pull/8468","diff_url":"https://github.com/ansible/ansible/pull/8468.diff","patch_url":"https://github.com/ansible/ansible/pull/8468.patch"},"body":"##### Issue Type:\r\n\r\nFeature Pull Request\r\n\r\n##### Ansible Version:\r\n\r\n```\r\nansible 1.7 (devel 0bb1c85)\r\n```\r\n\r\n##### Environment:\r\n\r\nAll\r\n\r\n##### Summary:\r\n\r\nAdd a `re_escape` filter to allow escaping special re chars. This is useful\r\nfor example for the `lineinfile` module if you have special characters.\r\n\r\n\r\n##### How to use:\r\n\r\n\r\n```yml\r\n- name: Create sudo entry\r\n  lineinfile:\r\n    dest: \"/etc/sudoers.d/{{ item.name }}\"\r\n    mode: 0440\r\n    create: yes\r\n    regexp: '^{{ item.line|re_escape() }}'\r\n    line: '{{ item.line | default() }}'\r\n    state: '{{ item.state | default(\"present\") }}'\r\n  with_items:\r\n    - { name: john, line: 'Host_Alias HOSTS = dev*' }\r\n    - { name: john, line: 'john HOSTS=(ALL) NOPASSWD:ALL' }\r\n\r\n\r\n```\r\n"},"comment":{"url":"https://api.github.com/repos/ansible/ansible/issues/comments/125018554","html_url":"https://github.com/ansible/ansible/pull/8468#issuecomment-125018554","issue_url":"https://api.github.com/repos/ansible/ansible/issues/8468","id":125018554,"user":{"login":"renard","id":383821,"avatar_url":"https://avatars.githubusercontent.com/u/383821?v=3","gravatar_id":"","url":"https://api.github.com/users/renard","html_url":"https://github.com/renard","followers_url":"https://api.github.com/users/renard/followers","following_url":"https://api.github.com/users/renard/following{/other_user}","gists_url":"https://api.github.com/users/renard/gists{/gist_id}","starred_url":"https://api.github.com/users/renard/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/renard/subscriptions","organizations_url":"https://api.github.com/users/renard/orgs","repos_url":"https://api.github.com/users/renard/repos","events_url":"https://api.github.com/users/renard/events{/privacy}","received_events_url":"https://api.github.com/users/renard/received_events","type":"User","site_admin":false},"created_at":"2015-07-26T17:11:31Z","updated_at":"2015-07-26T17:11:31Z","body":"@amenonsen #11743 should fix your issue there. Hope this won't take one more year to be merged."}}