##### 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) }}"
```
else:
        raise AnsibleFilterError('subelements must be a list or a string')
    results = []
    for element in element_list:
        values = element
        for subelement in subelement_list:
            try:
                values = values[subelement]
            except KeyError:
                if skip_missing:
                    values = []
                    break
                raise AnsibleFilterError("could not find %r key in iterated item %r" % (subelement, values))
            except TypeError:
                raise AnsibleFilterError("the key %s should point to a dictionary, got '%s'" % (subelement, values))
        if not isinstance(values, list):
            raise AnsibleFilterError("the key %r should point to a list, got %r" % (subelement, values))
        for value in values:
            results.append((element, value))
    return results
def dict_to_list_of_dict_key_value_elements(mydict, key_name='key', value_name='value'):
    ''' takes a dictionary and transforms it into a list of dictionaries,
        with each having a 'key' and 'value' keys that correspond to the keys and values of the original '''
    if not isinstance(mydict, Mapping):
        raise AnsibleFilterError("dict2items requires a dictionary, got %s instead." % type(mydict))
    ret = []
    for key in mydict:
        ret.append({key_name: key, value_name: mydict[key]})
    return ret
def list_of_dict_key_value_elements_to_dict(mylist, key_name='key', value_name='value'):