Hi Bill.

The issues are your unerstanding of regular expressions.

> I had hoped to find a help list because this may be my problem, but here
> goes:
>
> grep --color '^[[:alpha:]]*' xxx
> Lists every line including blank lines, highlighting leading alpha strings.

Correct. The * means zero or more alphabetic characters, and ^ means beginning
of line. The ^ always matches every line, even though the [[:alpha:]]* may
not.

> grep --color '^[[:alpha:]][[:alpha:]]*' xxx
> Lists every line starting with an alpha and highlights all leading alphas.
> This is what I wanted, so I tried rewriting the spec as:
>
> grep --color '^[[:alpha:]]+' xxx
> lists nothing.

For grep, you need '^[[:alpha:]]\+'.

HTH,

Arnold

Reply via email to