Can we use regex in single-line mode with ansible module like lineinfile [dot matches all, dotall, re.S, (?s)]

Ansible docs point us on python re web site for regex. In this page, modifiers like ignore case, single line mode are documented, but it seems not supported when used with ansible module where regex is used (like lineinfile)
Someone find out how works with (?s) aka single-line mode?

usage: useful to insert line in the rigth place in a file like:

Input:

foo o o foo bar a r

regex to insert “foobar” line after “foo” followed by “bar”

(?s)(.*?foo.*?\n)(bar.*)

substitution:

\1foobar\n\2

Result:

foo o o foo foobar bar a r

ref.: https://docs.python.org/2/library/re.html
"…
(?iLmsux)

(One or more letters from the set 'i', 'L', 'm', 's', 'u', 'x'.) The group matches the empty string; the letters set the corresponding flags: re.I (ignore case), re.L (locale dependent), re.M (multi-line), re.S (dot matches all), re.U (Unicode dependent), and re.X (verbose), for the entire regular expression. (The flags are described in Module Contents.) This is useful if you wish to include the flags as part of the regular expression, instead of passing a flag argument to the re.compile() function.

…"

Ansible should support this since is build-in in python and look very easy to support.

(Note: I am pretty new with ansible, python and i am not english. So, no bashing will be apreciated… i am looking for a solution not useless comments)

UPDATE: I tested the re.IGNORECASE inline modifier (?i) and this one work well. I dont know why the single line modifier (?s) don’t works then.

lineinfile applies the regex to single lines already, it does not
apply it against the whole document, so adding single line parsing is
useless.

[SOLVED]
ALL GOOD, i discover than “replace” module works well with DOTALL flag.