Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #70692

Re:problem with regex

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!weretis.net!feeder1.news.weretis.net!feeder4.news.weretis.net!rt.uk.eu.org!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.003
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'string.': 0.05; 'assign': 0.07; 'string': 0.09; 'escape': 0.09; 'interpreted': 0.09; 'literal': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'wrote': 0.14; 'thread': 0.14; 'backslashes': 0.16; 'literal,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'skip:t 150': 0.16; 'variable': 0.18; 'subject:problem': 0.24; 'file.': 0.24; 'looks': 0.24; 'compare': 0.26; 'second': 0.26; 'header:X-Complaints-To:1': 0.27; 'getting': 0.31; 'lines': 0.31; 'quotes': 0.31; 'txt': 0.31; 'file': 0.32; 'probably': 0.32; 'figure': 0.32; 'raw': 0.33; 'subject:with': 0.35; 'agree': 0.35; 'test': 0.35; 'but': 0.35; 'really': 0.36; 'like,': 0.36; 'similar': 0.36; 'two': 0.37; 'to:addr:python-list': 0.38; 'expect': 0.39; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'even': 0.60; "you're": 0.61; 'first': 0.61; 'times': 0.62; 'email addr:gmail.com': 0.63; 'here': 0.66; 'minutes': 0.67; 'subject::': 0.85; 'imagine': 0.93
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Dave Angel <davea@davea.name>
Subject Re:problem with regex
Date Mon, 28 Apr 2014 15:33:46 -0400 (EDT)
Organization news.gmane.org
References <caeba811-441e-42a0-9b2b-c743205b1f82@googlegroups.com>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8
Content-Transfer-Encoding 7bit
X-Gmane-NNTP-Posting-Host dpc6744197045.direcpc.com
X-Newsreader PiaoHong.NewsGroup.Client.VIP:1.52
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.9556.1398713268.18130.python-list@python.org> (permalink)
Lines 20
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1398713268 news.xs4all.nl 2910 [2001:888:2000:d::a6]:58783
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:70692

Show key headers only | View raw


dimmaim@gmail.com Wrote in message:
> i want to find a specific urls from a txt file but i have some issus. First when i take just two lines from the file with copy paste and assign it to a variable like this and it works only with triple quotes
>  
> test='''_*_n.jpg","timelineCoverPhoto":"{\"focus\":{\"x\":0.5,\"y\":0.386925795053},\"photo\":{\"__type__\":{\"name\":\"Photo\"},\"image_lowres\":{\"uri\":\"https://fbcdn-photos-f-a.akamaihd.net/*-*-*

Why did you start a second thread with similar content two minutes
 after the first? Do you expect us to compare the two messages and
 figure out what you changed,  or were you just impatient for a
 response?  I only check in here about 6 times a day, and I
 imagine some might be even less often.

Your test string literal has lots of backslashes in it, which get
 interpreted into escape sequences in a literal,  but not in a
 file.  If that's really what the file looks like,  you're going
 to want to use a raw string.  I agree with Roy, you're probably
 not getting the same string the two ways.

-- 
DaveA

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

problem with regex dimmaim@gmail.com - 2014-04-28 05:52 -0700
  Re: problem with regex Roy Smith <roy@panix.com> - 2014-04-28 09:03 -0400
  Re:problem with regex Dave Angel <davea@davea.name> - 2014-04-28 15:33 -0400

csiph-web