[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: what is the regular expression that matches nothing? -- I think it i
From: |
Andrei Voropaev |
Subject: |
Re: what is the regular expression that matches nothing? -- I think it is the null expression. When I do "egrep '' somefile" the result is the same as when I do "cat somefile". The result of "egrep -v '' somefile" is, as expected, nothing. HTH |
Date: |
27 Dec 2004 08:35:44 GMT |
User-agent: |
slrn/0.9.8.1 (Linux) |
On 2004-12-24, Randy Yates <yates@ieee.org> wrote:
> Stan Brown <the_stan_brown@fastmail.fm> writes:
>
>> There is no regular expression that matches nothing.
>>
>> I you want to match a zero-length line, use
>> ^$
>>
>> But the idea of matching nothing has an inherent contradiction.
>
> I don't see that. Can you explain why you say this?
>
>> Why don't you tell us what you're actually trying to accomplish?
>
> Sure, Stan. I'm trying to setup the EFS package in XEmacs to use a
> gateway for FTP. In this mode, EFS requires a regular expression to
> identify which machines are accessible without having to go through
> the gateway. In my case (this is at work where we have a firewall)
> that would be "no machine," i.e., all machines I FTP to (with XEmacs)
> will be outside the firewall. Thus the regexp has to match "nothing."
Assuming, that you don't have empty names in your configuration, the
above pattern ^$ won't match any of your names.
Andrei
- what is the regular expression that matches nothing?, Randy Yates, 2004/12/23
- Re: what is the regular expression that matches nothing? -- I think it is the null expression. When I do "egrep '' somefile" the result is the same as when I do "cat somefile". The result of "egrep -v '' somefile" is, as expected, nothing. HTH, me, 2004/12/23
- Re: what is the regular expression that matches nothing? -- I think it is the null expression. When I do "egrep '' somefile" the result is the same as when I do "cat somefile". The result of "egrep -v '' somefile" is, as expected, nothing. HTH, Randy Yates, 2004/12/23
- Re: what is the regular expression that matches nothing?, me, 2004/12/23
- Re: what is the regular expression that matches nothing? -- I think it is the null expression. When I do "egrep '' somefile" the result is the same as when I do "cat somefile". The result of "egrep -v '' somefile" is, as expected, nothing. HTH, Stan Brown, 2004/12/23
- Re: what is the regular expression that matches nothing? -- I think it is the null expression. When I do "egrep '' somefile" the result is the same as when I do "cat somefile". The result of "egrep -v '' somefile" is, as expected, nothing. HTH, Randy Yates, 2004/12/24
- Re: what is the regular expression that matches nothing? -- I think it is the null expression. When I do "egrep '' somefile" the result is the same as when I do "cat somefile". The result of "egrep -v '' somefile" is, as expected, nothing. HTH,
Andrei Voropaev <=
Re: what is the regular expression that matches nothing?, Paul Jarc, 2004/12/27