Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > gnu.utils.bug > #2225 > unrolled thread

Re: Bug of grep -E

Started byJohn Cowan <cowan@ccil.org>
First post2017-12-06 10:45 -0500
Last post2017-12-06 10:45 -0500
Articles 1 — 1 participant

Back to article view | Back to gnu.utils.bug

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: Bug of grep -E John Cowan <cowan@ccil.org> - 2017-12-06 10:45 -0500

#2225 — Re: Bug of grep -E

FromJohn Cowan <cowan@ccil.org>
Date2017-12-06 10:45 -0500
SubjectRe: Bug of grep -E
Message-ID<mailman.5227.1512575149.27995.bug-gnu-utils@gnu.org>
Backslash is not an escape in character classes.  The only way to get a -
in a character class is to make sure it is at the end or the beginning.  So
in your second pattern, the sequence \-% means "every character from
backslash to percent', which is no characters at all.

On Wed, Dec 6, 2017 at 10:02 AM, iPack <2741547153@qq.com> wrote:

> [urain39@urain39-pc ~]$ cat test
> https://konachan.com/image/a4ff5caad2fa35faa2271df9badacd
> 35/Konachan.com%20-%20255941%20blush%20brown_eyes%20crying%
> 20fate_kaleid_liner_prisma_illya%20fate_%28series%29%
> 20japanese_clothes%20kimono%20long_hair%20miyu_edelfelt%
> 20purple_hair%20tagme_%28artist%29%20tears.jpg
>
> [urain39@urain39-pc ~]$ cat test | grep -Eo '[0-9a-f]{32}/[0-9A-Za-z%_\.\-
> ]+'
> a4ff5caad2fa35faa2271df9badacd35/Konachan.com%20-%20255941%
> 20blush%20brown_eyes%20crying%20fate_kaleid_liner_prisma_
> illya%20fate_%28series%29%20japanese_clothes%20kimono%
> 20long_hair%20miyu_edelfelt%20purple_hair%20tagme_%28artist%29%20tears.jpg
>
> [urain39@urain39-pc ~]$ cat test | grep -Eo '[0-9a-f]{32}/[0-9A-Za-z\-%_\.
> ]+'
> a4ff5caad2fa35faa2271df9badacd35/Konachan.com%20
>
> It is bug ? or just my syntax error ?

[toc] | [standalone]


Back to top | Article view | gnu.utils.bug


csiph-web