Results 1 to 3 of 3

Thread: grep problem

  1. #1
    Join Date
    Feb 2004
    Posts
    6

    Unanswered: grep problem

    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

  2. #2
    Join Date
    Feb 2004
    Posts
    6
    Another problem:
    grep: Trailing backslash

    mup: line 24: [: !=: unary operator expected

  3. #3
    Join Date
    Jan 2004
    Location
    Bordeaux, France
    Posts
    320

    Re: grep problem

    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]*$'
    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.
    Jean-Pierre.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •