add regexp crate to Rust distribution (implements RFC 7) by BurntSushi · Pull Request #13700 · rust-lang/rust (original) (raw)
I don't really like re
because I think it's too short. Note that Python's original regexp module was called regex
. (re
was added in Python 1.5 and regex
wasn't removed until Python 2.5, so they had to coexist.) I do like the notion of writing re::Regexp
, but I also think it's useful for the name of the crate to stand on its own.
I would not be opposed to naming the macro re!
though, it seemed like there was some value in making it the same name as the crate. I don't feel strongly about it.
- Languages that use some variation of
regexp
: Go, Ruby, Javascript - Languages that use some variation of
regex
: C++, Java, Python, OCaml, Haskell
(The .NET crowd is notably missing, but they call their module RegularExpressions
. Objective C calls theirs NSRegularExpression
.)
I don't know what it means to choose one name over another based on Google Trends telling me that there is a 0.0000098675%
difference between the two in 2008.
There seems to be a slight overall preference toward Regex
and there are more language libraries using Regex
as the name of their module which provides regexps. If I switch the name of the crate, type and macro to regex
, Regex
and regex!
, respectively, will that make everyone reasonably happy?