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

Error on searching on oneline texts with option --only-matching #463

Closed
funkill opened this issue Apr 27, 2017 · 2 comments
Closed

Error on searching on oneline texts with option --only-matching #463

funkill opened this issue Apr 27, 2017 · 2 comments
Labels
duplicate An issue that is duplicative of another.

Comments

@funkill
Copy link

funkill commented Apr 27, 2017

When searching in oneline text (e.g. minified json) with option --only-matching, I got the result only first match.

$ rg --version
ripgrep 0.5.1
$ cat ./test.json 
[{"character":"a","code":"U+0061"},{"character":"b","code":"U+0062"},{"character":"c","code":"U+0063"},{"character":"d","code":"U+0064"},{"character":"e","code":"U+0065"},{"character":"f","code":"U+0066"},{"character":"g","code":"U+0067"}]
$ rg '"character":"[\w]"' ./test.json 
1:[{"character":"a","code":"U+0061"},{"character":"b","code":"U+0062"},{"character":"c","code":"U+0063"},{"character":"d","code":"U+0064"},{"character":"e","code":"U+0065"},{"character":"f","code":"U+0066"},{"character":"g","code":"U+0067"}]
$ rg '"character":"[\w]"' -o ./test.json 
1:"character":"a"
1:"character":"a"
1:"character":"a"
1:"character":"a"
1:"character":"a"
1:"character":"a"
1:"character":"a"
@BurntSushi
Copy link
Owner

I think this is a dupe of #451 is fixed on master.

@BurntSushi BurntSushi added the duplicate An issue that is duplicative of another. label Apr 27, 2017
@kpp
Copy link
Contributor

kpp commented Apr 27, 2017

Already fixed

~/ripgrep$ git rev-parse HEAD
362abed44a000da3b31e5dd027e16eb4e36e1bed
~/ripgrep$ cargo run -- '"character":"[\w]"' -o ./tests/test.json
    Finished dev [unoptimized + debuginfo] target(s) in 0.0 secs
     Running `target/debug/rg '"character":"[\w]"' -o ./tests/test.json`
1:"character":"a"
1:"character":"b"
1:"character":"c"
1:"character":"d"
1:"character":"e"
1:"character":"f"
1:"character":"g"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate An issue that is duplicative of another.
Projects
None yet
Development

No branches or pull requests

3 participants