summaryrefslogtreecommitdiffhomepage
path: root/src/blog/grab/example-1.sh
blob: 97a42777395fc5b4f5928cf7718245ce9edb587e (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ cat foo
Hello world, this is
a paragraph.

This is also a paragraph
but it contains doubled
doubled words.
$ grab 'x/[^\n].+?(?=\n\n|$)/ g/(\b\w+\b)\s+\1/' foo
This is also a paragraph
but it contains doubled
doubled words.
$ # Just like grep, you can display match positions
$ grab -f '…' foo
foo:4:1:This is also a paragraph
but it contains doubled
doubled words.