Deprecate matchall#26071
Conversation
|
|
||
| matchList = String[replace(s, r"\s" => "\\ ") for s in matches] | ||
| startpos = pos - lastindex(prefix) + 1 - length(matchall(r" ", prefix)) | ||
| startpos = pos - lastindex(prefix) + 1 - count(c -> c == ' ', prefix) |
There was a problem hiding this comment.
I hope this change is correct. AFAICT it is, but the original code is such a convoluted way of doing this that I feel like I may be missing something.
There was a problem hiding this comment.
Looks right to me, too. Could be equalto(' ').
There was a problem hiding this comment.
Yeah, I realized that right after pushing. Fixed while rebasing.
5665931 to
3395955
Compare
|
I'll merge once CI passes barring objections. |
| @test f(r"GCG","GCGCG") == ["GCG"] | ||
| @test f(r"GCG","GCGCG",overlap=true) == ["GCG","GCG"] | ||
| end | ||
| @test collect_eachmatch(r"a?b?", "asbd") == ["a","","b","",""] == f(r"""a?b?""", "asbd") |
There was a problem hiding this comment.
You've got an old f() call in here.
It is not obvious that returning matching SubStrings rather than RegexMatch objects is a good idea.
3395955 to
52b5205
Compare
|
Ruby has a Is it too late to add (or reserve) this name for julia-07? I'd much more prefer: -- Maurice |
|
There's no need to reserve names: exporting new names from Base is not considered breaking. |
|
Bonjour, This post is moved to discourse: So what is the best way from julia-1.3+ for getting a String Vector from a regex like with matchall? -- Maurice |
|
Instead of commenting on old issues, it is better to open a new thread at https://discourse.julialang.org/ for questions. |
I'd like to lightly disagree with this statement. I found this issue by using the changelog. I was looking for why Of course, the true value is the cross-link to the discourse page, but since that doesn't happen automatically it's valuable to see discourse open here before ultimately moving to a better home. |
It is not obvious that returning matching
SubStrings rather thanRegexMatchobjects is a good idea.Fixes #26049.