Re: [ansible-project] regexp multiline

12 views
Skip to first unread message

Dick Visser

unread,
Nov 7, 2017, 4:19:18 PM11/7/17
to ansible...@googlegroups.com
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 <jharmon...@gmail.com> 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 ansible-proje...@googlegroups.com.
> To post to this group, send email to ansible...@googlegroups.com.
> 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
Reply all
Reply to author
Forward
0 new messages