Quote:
Originally posted by estumator
Hi,I want to match a string which begins with a capital letter and followed by any number of characters in alphabate, in which case I used
"grep -E '^[A-Z][A-Za-z]+$'" as regular expression, but the "+" doesn't seem to work............somehow
|
If any number of characters in alphabate can follow the first one, '+' is not the right operator
'+' is for 'or or more'
'*' is for any
try:
Code:
grep -E '^[A-Z][A-Za-z]*$'
Quote:
Originally posted by estumator Another problem:
grep: Trailing backslash
mup: line 24: [: !=: unary operator expected
|
What is the grep command ?
It seems that your grep is inside an 'if' statement ([ !=), if true give us also the 'if' statement.