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

Document default regex anchoring semantics (#1631) #1648

Merged
merged 1 commit into from Jun 27, 2020

Conversation

yurikhan
Copy link
Contributor

@yurikhan yurikhan commented Jun 21, 2020

Change Summary

Document that regex is checked using re.match. Suggest a way to write regular expressions that have the same meaning in Pydantic and JSON Schema.

Related issue number

#1631

Checklist

  • changes/<pull request or issue id>-<github username>.md file added describing change
    (see changes/README.md for details)

@codecov
Copy link

codecov bot commented Jun 21, 2020

Codecov Report

Merging #1648 into master will not change coverage.
The diff coverage is n/a.

@@            Coverage Diff            @@
##            master     #1648   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           21        21           
  Lines         3798      3798           
  Branches       752       752           
=========================================
  Hits          3798      3798           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0cee311...8417d19. Read the comment docs.

@yurikhan yurikhan marked this pull request as ready for review June 21, 2020 13:15
@samuelcolvin samuelcolvin merged commit 908f6ed into pydantic:master Jun 27, 2020
@samuelcolvin
Copy link
Member

great, thanks.

either explicitly anchor your regular expressions with `^`
(e.g. `^foo` to match any string starting with `foo`),
or explicitly allow an arbitrary prefix with `.*?`
(e.g. `.*?foo` to match any string containig the substring `foo`).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo here: containig -> containing

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry! Do I open a new PR or what?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess so, only needs to be a tiny fix.

@yurikhan yurikhan mentioned this pull request Jul 1, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants