D**M I've got to stop using this F**** gmail and get back to basics

$ cat p | egrep -cE '^P[[:digit:]]{5}'
4



On Sat, Jul 4, 2015 at 7:52 PM, Pete Lancashire <[email protected]>
wrote:

>
> $ cat p
> P12345
> P123
> P12
> P1
> S1
> S12
> S123
> S1234
> S12345
> P1234
> P123456
> P1234z
> P12345a
> P12345abc
>
> $ cat p | egrep -ce '^P[[:digit:]]{5}'
> 4
>
> $ cat p | grep -ce '^P[[:digit:]]{5}'
> 0
>
> OH OH .. should be (upper case) E :-)
> $ cat p | grep -ce '^P[[:digit:]]{5}'
> 0
>
>
>
>
>
> On Sat, Jul 4, 2015 at 7:43 PM, Rich Shepard <[email protected]>
> wrote:
>
>> On Sat, 4 Jul 2015, Pete Lancashire wrote:
>>
>> > don't forget to end the regexp stop with a non-digit if you dont
>> > P12345<anything> will pass.
>>
>>    There is content after the Pnnnnn; all I want is a count of the number
>> of
>> lines beginning with Pnnnnn.
>>
>> Rich
>> _______________________________________________
>> PLUG mailing list
>> [email protected]
>> http://lists.pdxlinux.org/mailman/listinfo/plug
>>
>
>
_______________________________________________
PLUG mailing list
[email protected]
http://lists.pdxlinux.org/mailman/listinfo/plug

Reply via email to