##### 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) }}"
```
return to_text(base64.b64encode(to_bytes(string, encoding=encoding, errors='surrogate_or_strict')))
def b64decode(string, encoding='utf-8'):
    return to_text(base64.b64decode(to_bytes(string, errors='surrogate_or_strict')), encoding=encoding)
def flatten(mylist, levels=None):
    ret = []
    for element in mylist:
        if element in (None, 'None', 'null'):
            
            break
        elif is_sequence(element):
            if levels is None:
                ret.extend(flatten(element))
            elif levels >= 1:
                
                ret.extend(flatten(element, levels=(int(levels) - 1)))
            else:
                ret.append(element)
        else:
            ret.append(element)
    return ret
def subelements(obj, subelements, skip_missing=False):