Skip to content

Fixes #13843 (empty regexes are now valid) #14634

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

Merged
merged 1 commit into from
Jun 4, 2014

Conversation

BurntSushi
Copy link
Member

An empty regex is a valid regex that always matches. This behavior
is consistent with at least Go and Python.

A couple regression tests are included.

I'd just assume that an empty regex is an invalid regex and that an error should be returned (I can't think of any reason to use an empty regex?), but it's probably better to be consistent with other regex libraries.

An empty regex is a valid regex that always matches. This behavior
is consistent with at least Go and Python.

A couple regression tests are included.
@lilyball
Copy link
Contributor

lilyball commented Jun 4, 2014

I can't think of any reason to use an empty regex?

When it's provided by the user. Empty regexes are expected to match at every single index in the file. For example, a split function that uses a regex can take an empty regex to split into characters.

@BurntSushi
Copy link
Member Author

@kballard Ah, I forgot about splitting. Sounds good to me.

@BurntSushi
Copy link
Member Author

see #13843

bors added a commit that referenced this pull request Jun 4, 2014
An empty regex is a valid regex that always matches. This behavior
is consistent with at least Go and Python.

A couple regression tests are included.

I'd just assume that an empty regex is an invalid regex and that an error should be returned (I can't think of any reason to use an empty regex?), but it's probably better to be consistent with other regex libraries.
@bors bors closed this Jun 4, 2014
@bors bors merged commit 9d39178 into rust-lang:master Jun 4, 2014
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2023
fix: Report remaining macro errors in assoc item collection
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.

4 participants