Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 27 Jul 2001 13:14:29 -0700 (PDT)
From:      Jason La <jasonla00@yahoo.com>
To:        freebsd-questions@freebsd.org
Subject:   Regular Expression Help
Message-ID:  <20010727201429.24359.qmail@web4605.mail.yahoo.com>

next in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20010727201429.24359.qmail>