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

Cleaned up the matchPattern regex code #14552

Merged
merged 2 commits into from
Jun 13, 2017

Conversation

knobunc
Copy link
Contributor

@knobunc knobunc commented Jun 9, 2017

  • Changed it to use raw strings to reduce the leaning-toothpick syndrome from all of the necessary escaping
  • Changed it to use \A and \z around the regex, so that if the regex is put into multi-line mode with (?m) then it will match the whole string
  • Changed it so that the () around their regex is (?:) to make it non-capturing

- Changed it to use raw strings to reduce the leaning-toothpick syndrome from all of the necessary escaping
- Changed it to use \A and \z around the regex, so that if the regex is put into multi-line mode with (?m) then it will match the whole string
- Changed it so that the () around their regex is (?:) to make it non-capturing
@knobunc
Copy link
Contributor Author

knobunc commented Jun 9, 2017

[test]

@openshift/networking PTAL

@danwinship
Copy link
Contributor

*cough* unit tests *cough*

Added testing of the patternMatch function that can be called from the template.  This does some basic positive and negative testing of patterns, and then has some more sophisticated tests to make sure the additional structure we add around the regex to anchor it to match the entire string does not misbehave.
@openshift-bot
Copy link
Contributor

Evaluated for origin test up to 35da20c

@openshift-bot
Copy link
Contributor

continuous-integration/openshift-jenkins/test SUCCESS (https://ci.openshift.redhat.com/jenkins/job/test_pull_request_origin/2073/) (Base Commit: 0f82878)

@imcsk8
Copy link
Contributor

imcsk8 commented Jun 10, 2017

LGTM

1 similar comment
@JacobTanenbaum
Copy link
Contributor

LGTM

@knobunc
Copy link
Contributor Author

knobunc commented Jun 12, 2017

@danwinship thanks for the hint :-) Done.

@knobunc
Copy link
Contributor Author

knobunc commented Jun 12, 2017

[merge]

@knobunc
Copy link
Contributor Author

knobunc commented Jun 13, 2017

@openshift-bot
Copy link
Contributor

Evaluated for origin merge up to 35da20c

@openshift-bot
Copy link
Contributor

openshift-bot commented Jun 13, 2017

continuous-integration/openshift-jenkins/merge SUCCESS (https://ci.openshift.redhat.com/jenkins/job/merge_pull_request_origin/984/) (Base Commit: a5b8471) (Image: devenv-rhel7_6350)

@openshift-bot openshift-bot merged commit 599a720 into openshift:master Jun 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants