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

Regex editorial improvements, and permit "." #1470

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

lukem
Copy link

@lukem lukem commented Nov 11, 2023

Add "." to the permitted simple atoms, for issue #1469.
Consistently format the regex examples.

Consistently "quote" examples.
Split complemented simple and range class examples.
Improve "(" .. ")" grouping example.
jsonschema-core.md Outdated Show resolved Hide resolved
- simple character classes ("[abc]"), range character classes ("[a-z]");
- complemented simple character classes ("[^abc]"),
complemented range character classes ("[^a-z]");
- simple quantifiers: "." (any character except line terminator),
Copy link
Contributor

Choose a reason for hiding this comment

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

. is not a quantifier, doesn't belong here. I think it should be up just after literal characters / before character classes.

Copy link
Author

Choose a reason for hiding this comment

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

Ok, how about the following, moved as you suggest?

  • simple atoms: "." (any character except line terminator);

Copy link
Contributor

Choose a reason for hiding this comment

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

That looks good to me

Copy link
Author

Choose a reason for hiding this comment

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

Fixed in commit 65b250c

@gregsdennis
Copy link
Member

gregsdennis commented Feb 15, 2024

We've discussed this before, and I think it may be worth bringing it up again.

IETF has now published https://datatracker.ietf.org/doc/rfc9485/ to support interoperable regex in JSON Path. It may be wise to reconsider this in place of ECMA. Doing so would mean being able to remove all of these restrictions.

@notEthan
Copy link
Contributor

@gregsdennis I feel like I'm inclined to agree with this person's opinion that iregexp is not a good fit for JSON Schema - though I have not kept up with any changes since 2022 that may have changed that situation.

@gregsdennis
Copy link
Member

Yeah, I hear you. But finding interoperable regex support has been a thorn in our side for a long time.

It really has no bearing on this PR, though.

jsonschema-core.md Outdated Show resolved Hide resolved
@lukem
Copy link
Author

lukem commented Feb 22, 2024

I've added 3 commits addressing various review feedback above.

Comment on lines 405 to 406
- complemented simple character classes (`[^abc]`),
complemented range character classes (`[^a-z]`);
Copy link
Member

Choose a reason for hiding this comment

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

This feels weird to me. Either make them separate bullets

Suggested change
- complemented simple character classes (`[^abc]`),
complemented range character classes (`[^a-z]`);
- complemented simple character classes (`[^abc]`);
- complemented range character classes (`[^a-z]`);

or combine them

Suggested change
- complemented simple character classes (`[^abc]`),
complemented range character classes (`[^a-z]`);
- complemented simple (`[^abc]`) and range (`[^a-z]`) character classes;

Copy link
Author

Choose a reason for hiding this comment

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

I have made the first suggestion; keeping the multi-word terms together before the example makes it easier to search for those terms. I.e, a (cross-)reference to the term "complemented range" is easier to find that way.
See commit ac0a13c

Copy link
Member

@gregsdennis gregsdennis left a comment

Choose a reason for hiding this comment

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

This looks fine to me.

@gregsdennis gregsdennis requested a review from a team February 23, 2024 02:04
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