From owner-freebsd-questions Fri Jul 27 13:14:31 2001 Delivered-To: freebsd-questions@freebsd.org Received: from web4605.mail.yahoo.com (web4605.mail.yahoo.com [216.115.105.160]) by hub.freebsd.org (Postfix) with SMTP id 584AE37B401 for ; Fri, 27 Jul 2001 13:14:29 -0700 (PDT) (envelope-from jasonla00@yahoo.com) Message-ID: <20010727201429.24359.qmail@web4605.mail.yahoo.com> Received: from [209.179.254.56] by web4605.mail.yahoo.com via HTTP; Fri, 27 Jul 2001 13:14:29 PDT Date: Fri, 27 Jul 2001 13:14:29 -0700 (PDT) From: Jason La Reply-To: jasonla@pobox.com Subject: Regular Expression Help To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG I am looking for a little regular expression help, namely with the "{}" operators. Below is the file (inventory.txt) that I am working with. Jan 13 25 15 115 Jun 31 42 75 492 Jul 24 34 67 436 June 19 23 0 846 Jaa 19 23 0 846 I want to match a line that begins with "J" and then has 2 letters after it. SO, all of the above should match except for "June" Here is the regular expression that I'm using (in gawk): gawk '/^J[a-zA-Z]{2}/ {print}' inventory.txt My problem is that nothing is matched... or at least nothing is printed on screen and I assume that nothing is matched. I have tried putting paranthesis around the character list, but that didn't work either. The brace operators are supposed to match the preceding regualar expression the specified number of times, right? Am I not understanding the use of the braces operators? Thank you for your time. ===== -- Jason La jasonla@pobox.com __________________________________________________ Do You Yahoo!? Make international calls for as low as $.04/minute with Yahoo! Messenger http://phonecard.yahoo.com/ To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message