Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi monks,
I know how to grep the index of an array for a pattern, but can I have a grep that can give me the index of the pattern, as well as the number of pattern occurance (in any form, not limited to array)?
(I think I see something on regex counting the number of occurance of a pattern, but I am not so clear for its syntax...may be somebody can give me some hint?)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Grep reutrn the occurance of a pattern
by Fletch (Bishop) on Mar 13, 2008 at 13:54 UTC | |
|
Re: Grep reutrn the occurance of a pattern
by moklevat (Priest) on Mar 13, 2008 at 13:56 UTC | |
|
Re: Grep reutrn the occurance of a pattern
by johngg (Canon) on Mar 13, 2008 at 13:59 UTC | |
|
Re: Grep reutrn the occurance of a pattern
by Narveson (Chaplain) on Mar 13, 2008 at 13:52 UTC | |
|
Re: Grep reutrn the occurance of a pattern
by Pancho (Pilgrim) on Mar 13, 2008 at 14:01 UTC | |
|
Re: Grep reutrn the occurance of a pattern
by ikegami (Patriarch) on Mar 13, 2008 at 15:56 UTC | |
|
Re: Grep reutrn the occurance of a pattern
by Anonymous Monk on Mar 14, 2008 at 01:19 UTC |