1 |
On 2005-07-25 17:50:37 +0800 (Mon, Jul), Zhang Weiwu wrote: |
2 |
> My RE must be wrong but I can hardly successfully match a whole line |
3 |
> like the below example: |
4 |
> |
5 |
> This works: |
6 |
> zhangweiwu@Bach:/tmp$ egrep "\b*\/[*].*[*]\/\b*" Calendar.php |
7 |
> /* $Id: class.boalarm.inc.php,v 1.1.1.1 2005/03/18 09:17:36 |
8 |
> dawnlinux Exp $ */ |
9 |
> /* $Id: class.boalarm.inc.php,v 1.11 2004/05/23 14:51:27 |
10 |
> ralfbecker Exp $ */ |
11 |
> |
12 |
> This doesn't work: |
13 |
> zhangweiwu@Bach:/tmp$ egrep "^\b*\/[*].*[*]\/\b*$" Calendar.php |
14 |
> |
15 |
> any hint? |
16 |
|
17 |
man grep: |
18 |
The symbol \b matches the empty string at the edge of a word |
19 |
|
20 |
It seems that '/' is not considered to be a part of a word. |
21 |
|
22 |
I suppose you may use "^[[:space:]]*/[*].*[*]/[[:space:]]*$" Calendar.php |
23 |
|
24 |
|
25 |
-- |
26 |
No virus found in this outgoing message. |
27 |
Checked by 'grep -i virus $MESSAGE' |
28 |
Trust me. |