There are currently only two flags available for use in regular expression filters in ansible, which appear to be 'ignorecase' and 'multiline':
https://github.com/ansible/ansible/blob/devel/lib/ansible/plugins/filter/core.py You're not entirely bound by these restrictions, because it's possible to set flags by having your expression start with them: https://docs.python.org/2/library/re.html (at the 'iLmsux' header). DIck On 6 November 2017 at 23:09, John Harmon <[email protected]> wrote: > I can muddle through regexp on a regex tester, but when I import it to > ansible it bombs. Is there a way to set flags, such as multiline under > ansible? Or am I writing this completely wrong? Basically I am trying to > fine this line as long as it isn't commented out: > > ^(?!#).*soft.*nofile.* > > Sample limits.conf: > #* soft nofile 4096 > * soft nofile 500000 > #* hard nofile 65535 > * hard nofile 500000 > * soft nproc 16384 > * hard nproc 65535 > * soft stack 4096 > * hard stack 65535 > * soft memlock 17384000 > * hard memlock 17384000 > > > -- > You received this message because you are subscribed to the Google Groups > "Ansible Project" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > To post to this group, send email to [email protected]. > To view this discussion on the web visit > https://groups.google.com/d/msgid/ansible-project/585dc03e-e33a-4d68-b717-0a7d7a9fe969%40googlegroups.com. > For more options, visit https://groups.google.com/d/optout. -- Dick Visser GÉANT Want to join us? We're hiring: https://www.geant.org/jobs -- You received this message because you are subscribed to the Google Groups "Ansible Project" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/ansible-project/CAL8fbwOQ5%2BgNZ9mpGdxPFzxUG283_qGyTso-%3D0TMGuqnGf_3ag%40mail.gmail.com. For more options, visit https://groups.google.com/d/optout.
