A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2003-May/035627.html below:

[Python-Dev] Re: [Python-checkins] python/dist/src/Lib warnings.py,1.19,1.20

[Python-Dev] Re: [Python-checkins] python/dist/src/Lib warnings.py,1.19,1.20Fred L. Drake, Jr. fdrake@acm.org
Thu, 15 May 2003 00:43:57 -0400
Charles G Waldman writes:
 > I'm afraid I must be missing something terribly obvious here, but why
 > would you need to escape a dot on a command line?  None of the shells
 > I'm familiar with treat dot as a metacharacter.  Isn't `?' the
 > standard shell metacharacter for "any character"?  Filename patterns
 > on the shell command line are "glob patterns", not RE's.

It's not the shell that treats it as a metacharacter, but the RE
syntax.  Preventing "." from being treated as an RE metacharacter
would be done by inserting a "\" character, which is a shell
metacharacter, and would need another "\" to escape that, so that one
of the "\" would end up in the RE.

Of course, my favorite way of dealing with this is to use single
quotes around the argument rather than backslashes; that works fine in
sh-syntax shells, and doesn't require doubling-up backslashes.



  -Fred

-- 
Fred L. Drake, Jr.  <fdrake at acm.org>
PythonLabs at Zope Corporation



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4