[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Color overlapping query?
From: |
Peng Yu |
Subject: |
Color overlapping query? |
Date: |
Tue, 26 Apr 2011 12:43:40 -0500 |
Hi,
I'm trying to search for two strings and what to color both of them if
both of them appear. But if the two strings overlap (e.g., abc and cde
overlap in abcde), I'm not how to color both of them. I tried the
following two ways, but neither of them work. Would you please let me
know if there is a way to do so? Thanks.
$ echo 'abcde' |grep --color=auto -P '(?=abc)|(?=cde)'
abcde
$ echo 'abcde' |grep --color=auto -P 'abc|cde'
abcde
--
Regards,
Peng
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Color overlapping query?,
Peng Yu <=