Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve regex_replace filter docs #57450

Merged
merged 3 commits into from Jun 13, 2019

Conversation

Projects
None yet
7 participants
@kustodian
Copy link
Contributor

commented Jun 6, 2019

SUMMARY

Added a few examples of how to correctly use regex_replace filter because it behaves differently on different Python versions when using regex qualifiers that can match an empty string (e.g. '*', '?', etc).

ISSUE TYPE
  • Docs Pull Request
COMPONENT NAME

Docs

ADDITIONAL INFORMATION

As described in #47838 regex_replaces behaves differently on Python 3.7 when a qualifier that can match an empty string (like *) is used. This docs update will add a note about that and a few good examples of how it should be used.

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jun 6, 2019

@kustodian kustodian force-pushed the kustodian:improve-regex-replace-docs branch from 45d4771 to e58cf0f Jun 6, 2019

@bcoca bcoca removed the needs_triage label Jun 6, 2019

@felixfontein
Copy link
Contributor

left a comment

Besides that, looks good to me.

@orthanc

This comment has been minimized.

Copy link
Contributor

commented Jun 11, 2019

Reads well to me, very clear with good examples.. The new behaviour seems crazy to me but that's on python, so documenting this as a gotcha is really worth while.

@acozine

This comment has been minimized.

Copy link
Contributor

commented Jun 11, 2019

@kustodian thanks for this PR! If you will accept the two suggestions (one from @felixfontein and one from @samccann, I will merge your contribution.

kustodian added some commits Jun 6, 2019

Improve regex_replace filter docs
Added a few examples of how to correctly use `regex_replace` filter
because it behaves differently on different Python versions when using
regex qualifiers that can match an empty string (e.g. '*', '?', etc).

@kustodian kustodian force-pushed the kustodian:improve-regex-replace-docs branch from e58cf0f to 6f95ccf Jun 12, 2019

@kustodian

This comment has been minimized.

Copy link
Contributor Author

commented Jun 12, 2019

@acozine I added the two suggestion and I also formatted the omit example to be pure YAML, because it's the recommended way of writing Ansible playbooks for a few years now.

@acozine

This comment has been minimized.

Copy link
Contributor

commented Jun 13, 2019

Looks good, thanks @kustodian! Thanks also to @felixfontein and @orthanc for reviewing.

@acozine acozine merged commit 6131de2 into ansible:devel Jun 13, 2019

1 check passed

Shippable Run 127346 status is SUCCESS.
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.