##### SUMMARY
I think the `regex_replace` jinja filter should support `multiline` as the `regex_search` do.
Or maybe use a `flags` parameter to support any `re` flag.

##### ISSUE TYPE
- Feature Idea

##### COMPONENT NAME
- `lib/ansible/plugins/filter/core.py`

##### ADDITIONAL INFORMATION
Example: comment a multiline variable.
```yaml
  val: "{{ val | regex_replace('^', '#', multiline=True) }}"
```
'''Accepts a dict or list of dicts, and a dotted accessor and produces a product
    of the element and the results of the dotted accessor
    >>> obj = [{"name": "alice", "groups": ["wheel"], "authorized": ["/tmp/alice/onekey.pub"]}]
    >>> subelements(obj, 'groups')
    [({'name': 'alice', 'groups': ['wheel'], 'authorized': ['/tmp/alice/onekey.pub']}, 'wheel')]
    '''
    if isinstance(obj, dict):
        element_list = list(obj.values())
    elif isinstance(obj, list):
        element_list = obj[:]
    else:
        raise AnsibleFilterError('obj must be a list of dicts or a nested dict')
    if isinstance(subelements, list):
        subelement_list = subelements[:]
    elif isinstance(subelements, string_types):
        subelement_list = subelements.split('.')