Re: Regular expression with egrep question...
- From: mik3l3374@xxxxxxxxx
- Date: Fri, 4 Jan 2008 00:35:20 -0800 (PST)
On Jan 4, 7:31 am, somebody <s...@xxxxxxxx> wrote:
Why will this regex match lines in myfile.txt which begin with a space:
egrep '^\ ' myfile.txt
And this one does not:
egrep '^\s+' myfile.txt
I thought tat the \s is space, and the + denotes more than one?
I tried using the -e switch to egrep too. Essentially I'm simply
trying to match lines like this:
Line one
Line two
Line three
Line four
-Thanks
maybe i am missing something..
sed -n "/^ /p" file
.
- Follow-Ups:
- Re: Regular expression with egrep question...
- From: Ed Morton
- Re: Regular expression with egrep question...
- References:
- Regular expression with egrep question...
- From: somebody
- Regular expression with egrep question...
- Prev by Date: Re: Regular expression with egrep question...
- Next by Date: Re: How to dump content of cmd shell buffer
- Previous by thread: Re: Regular expression with egrep question...
- Next by thread: Re: Regular expression with egrep question...
- Index(es):
Relevant Pages
|
|