Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #74328
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail |
|---|---|
| Return-Path | <kwpolska@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.027 |
| X-Spam-Evidence | '*H*': 0.95; '*S*': 0.00; 'languages,': 0.04; 'utf-8': 0.07; 'versions.': 0.07; 'string': 0.09; 'escape': 0.09; 'things,': 0.09; 'cc:addr:python-list': 0.11; 'python': 0.11; '3.1.2.': 0.16; '[2].': 0.16; 'string:': 0.16; 'url:html#re': 0.16; 'url:re': 0.16; 'url:split': 0.16; 'thanks,': 0.17; 'wrote:': 0.18; 'looked': 0.18; 'unlike': 0.19; 'example': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'chris': 0.29; 'quickly': 0.29; '[2]': 0.30; 'besides': 0.30; 'bigger': 0.30; 'characters': 0.30; 'mix': 0.30; 'message-id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; 'gives': 0.31; 'getting': 0.31; 'quotes': 0.31; 'regular': 0.32; 'url:python': 0.33; 'raw': 0.33; 'table': 0.34; 'sense': 0.34; 'operations': 0.35; 'received:google.com': 0.35; 'vice': 0.36; 'url:listinfo': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'two': 0.37; 'expressed': 0.37; 'being': 0.38; 'url:library': 0.38; 'pm,': 0.38; 'quote': 0.39; 'url:mail': 0.40; 'read': 0.60; 'around.': 0.60; 'enclosed': 0.60; 'expression': 0.60; 'tell': 0.60; 'url:3': 0.61; 'from:charset:utf-8': 0.61; 'url:index': 0.63; 'such': 0.63; 'skip:\xe2 10': 0.65; 'to:addr:gmail.com': 0.65; 'within': 0.65; 'between': 0.67; 'hour': 0.70; 'link:': 0.72; '8bit%:43': 0.74; 'jul': 0.74; 'special': 0.74; 'don\xe2\x80\x99t': 0.91 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=Xy/DUy1z4nLz0FYy8RclGj0qAfpBbeeylSfExcc7dKI=; b=laG2iGasJcVUi0sKFojtd89YjFvLc/IQjvnmOEKud9W15iISLZxQPt2cFZNJRNysOd 4dweIZm4/YT7dI7ZK78htdJZS3rBiidSHhlPQz/pdfByk+b9Mop+gM7KnzU/Sas86dDd VV0aF/xDlG3ggyAOctP/AgatMJSbNPT85gvnRGcVtMCjJBaQrNf6IkHIKeeXjXVmQ1VA 0nTIp1Sq4TtJ74i3uUKwtrc1bLr2yyjvpVYlcuVnkqD8LZLsuYuZDbc4AzkiaL+tZeoq Sx5eI9Nuyv/ix8bNsiX91QuodF+F//dtcjg2S/hOKBtDu7lD1fZp70wlNzsn94sEBBYi yAPg== |
| MIME-Version | 1.0 |
| X-Received | by 10.50.111.132 with SMTP id ii4mr24336620igb.18.1405016739049; Thu, 10 Jul 2014 11:25:39 -0700 (PDT) |
| In-Reply-To | <cfa25009-b200-4fcc-beb7-83634546cd20@googlegroups.com> |
| References | <cfa25009-b200-4fcc-beb7-83634546cd20@googlegroups.com> |
| Date | Thu, 10 Jul 2014 20:25:39 +0200 |
| Subject | Re: I am confused about ' and " |
| From | Chris “Kwpolska” Warrick <kwpolska@gmail.com> |
| To | fl <rxjwg98@gmail.com> |
| Content-Type | text/plain; charset=UTF-8 |
| Content-Transfer-Encoding | quoted-printable |
| Cc | python-list@python.org |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.15 |
| Precedence | list |
| List-Id | General discussion list for the Python programming language <python-list.python.org> |
| List-Unsubscribe | <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe> |
| List-Archive | <http://mail.python.org/pipermail/python-list/> |
| List-Post | <mailto:python-list@python.org> |
| List-Help | <mailto:python-list-request@python.org?subject=help> |
| List-Subscribe | <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe> |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.11742.1405016747.18130.python-list@python.org> (permalink) |
| Lines | 69 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1405016747 news.xs4all.nl 2873 [2001:888:2000:d::a6]:35192 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:74328 |
Show key headers only | View raw
On Jul 10, 2014 7:53 PM, "fl" <rxjwg98@gmail.com> wrote:
>
> Hi,
>
> It is still in the Regular expression operations concept, this link:
>
> has example using single quote mark: '
>
> https://docs.python.org/2/library/re.html#re.split
>
>
> While in this link:
>
> https://docs.python.org/3/howto/regex.html
>
>
> It gives table with quote: "
>
> Regular String Raw string
> "ab*" r"ab*"
> "\\\\section" r"\\section"
> "\\w+\\s+\\1" r"\w+\s+\1"
>
>
> and link:
>
> https://docs.python.org/2/library/re.html
>
>
> m = re.match(r"(\w+) (\w+)", "Isaac Newton, physicist")
>
>
> Please tell me because I have looked it around for one hour about it.
>
> Thanks,
> --
> https://mail.python.org/mailman/listinfo/python-list
Both characters (' and ") are interchangeable, the only difference
being the one you need to escape if you want to use in a string:
"you're" vs 'you\'re', and the other way around.
Also, please read the Python tutorial[0] before getting into bigger
things, and please don’t mix documentation versions. If you were to
read the tutorial, you’d quickly find out, that
> 3.1.2. Strings
>
> Besides numbers, Python can also manipulate strings, which can be
> expressed in several ways. They can be enclosed in single quotes
> ('...') or double quotes ("...") with the same result [2]. \ can be
> used to escape quotes.
>
> [snip]
>
> [2] Unlike other languages, special characters such as \n have the
> same meaning with both single ('...') and double ("...") quotes.
> The only difference between the two is that within single quotes
> you don’t need to escape "(but you have to escape \') and vice
> versa.
[0]: https://docs.python.org/2/tutorial/index.html
--
Chris “Kwpolska” Warrick <http://chriswarrick.com/>
PGP: 5EAAEA16
stop html mail | always bottom-post | only UTF-8 makes sense
Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread
I am confused about ' and " fl <rxjwg98@gmail.com> - 2014-07-10 10:01 -0700 Re: I am confused about ' and " John Gordon <gordon@panix.com> - 2014-07-10 17:16 +0000 Re: I am confused about ' and " Chris Angelico <rosuav@gmail.com> - 2014-07-11 03:57 +1000 Re: I am confused about ' and " Joel Goldstick <joel.goldstick@gmail.com> - 2014-07-10 14:12 -0400 Re: I am confused about ' and " Chris “Kwpolska” Warrick <kwpolska@gmail.com> - 2014-07-10 20:25 +0200
csiph-web