[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[ale] egrep question
- Subject: [ale] egrep question
- From: hne at hopnet.net (Keith Hopkins)
- Date: Sun, 17 Mar 2002 09:32:20 +0900
Ken Nagorski wrote:
> Hi there,
>
> How would I grep ^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+\.(com|org|net)$ using egrep,
> That works in perl but I just can't seem to get it to work using egrep!
>
> Thanks
> Ken
>
What exactly are you trying to do? It looks like it might find {bol}{one-or-more-alphanum}.{one-or-more-alphanum}.{domain}{eol}. Is that what you want?
keithh at hera:~> cat phred
abc123.hithere.com
abc^123.hithere.com
hitbox.org
www.hitbox.org
keithh at hera:~> egrep "^[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+\.(com|org|net)$" phred
abc123.hithere.com
www.hitbox.org
It works for me.
keithh at hera:~> egrep --version
egrep (GNU grep) 2.4.2
--
Lost in Tokyo,
Keith
Jack of All Trades, Anarchist
---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be
sent to listmaster at ale dot org.