-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #824 from y-yamagata/master
Fix literal word-regexp.
- Loading branch information
Showing
2 changed files
with
42 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
Setup: | ||
|
||
$ . $TESTDIR/setup.sh | ||
$ echo 'blah abc def' > blah1.txt | ||
$ echo 'abc blah def' > blah2.txt | ||
$ echo 'abc def blah' > blah3.txt | ||
$ echo 'abcblah def' > blah4.txt | ||
$ echo 'abc blahdef' >> blah4.txt | ||
$ echo 'blahx blah' > blah5.txt | ||
$ echo 'abcblah blah blah' > blah6.txt | ||
|
||
Match a word of the beginning: | ||
|
||
$ ag -wF --column 'blah' blah1.txt | ||
1:1:blah abc def | ||
|
||
Match a middle word: | ||
|
||
$ ag -wF --column 'blah' blah2.txt | ||
1:5:abc blah def | ||
|
||
Match a last word: | ||
|
||
$ ag -wF --column 'blah' blah3.txt | ||
1:9:abc def blah | ||
|
||
No match: | ||
|
||
$ ag -wF --column 'blah' blah4.txt | ||
[1] | ||
|
||
Match: | ||
|
||
$ ag -wF --column 'blah' blah5.txt | ||
1:7:blahx blah | ||
|
||
Case of a word repeating the same part: | ||
|
||
$ ag -wF --column 'blah blah' blah6.txt | ||
1:9:abcblah blah blah |