Re: grep: match i to j occurences of abc

From: Erik Max Francis (max_at_alcyone.com)
Date: 08/30/03

  • Next message: Numberwhun: "Re: Remove <CR> across HTML files"
    Date: Sat, 30 Aug 2003 14:17:55 -0700
    
    

    "Kurt J. Lanza" wrote:

    > Grep is the wrong tool. You are trying to match between 3 and 5
    > occurrences of the letter 'c'. That's why the man page refers to a
    > 'character'. (Duh.) Try 'awk' instead. I'm much to lazy to figure out
    > the details.

    It works fine with a pattern and egrep; on the contrary, grep is exactly
    the right tool for the job. (Duh on you.) The regular expression he
    wants is:

            grep '^(abc ?){3,5}$' test

    -- 
       Erik Max Francis && max@alcyone.com && http://www.alcyone.com/max/
     __ San Jose, CA, USA && 37 20 N 121 53 W && &tSftDotIotE
    /  \ I'm the woman whose / Three wishes came true
    \__/  Lamya
    

  • Next message: Numberwhun: "Re: Remove <CR> across HTML files"

    Relevant Pages

    • Re: subject line
      ... occurrences of a pattern, change the next 50 occurrences of a different ... personal computers something like this would not be too noticeable time ... Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org ...
      (comp.lang.ruby)
    • BASH: command line history-> word substitution????
      ... but this ONLY substitutes for the first occurrence of cpp! ... all occurrences of pattern are replaced? ... Shea M. ...
      (comp.unix.shell)
    • Index of the n-th occurrence
      ... How can I obtain all the indices of the occurrences of a pattern in a ... string? ... Marco ...
      (comp.lang.ruby)
    • __dict__ of object, Was: Regular Expression IGNORECASE different for findall and split?
      ... Split the source string by the occurrences of the pattern, returning a list containing the resulting substrings. ...
      (comp.lang.python)
    • Re: IF-condition help
      ... next month's examination. ... This is different to our sentence in question, which is of the pattern: ... not attend the seminar two weeks ago, and the future depends on which ... the "first conditional" refers to the ...
      (alt.usage.english)