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


Groups > comp.lang.python > #83626

Re: Python 3 regex woes (parsing ISC DHCPD config)

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed1.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <davea@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.004
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; 'output': 0.05; 'string.': 0.05; 'that?': 0.05; 'subject:Python': 0.06; 'reason,': 0.07; 'escape': 0.09; 'latter': 0.09; 'subject:parsing': 0.09; 'python': 0.11; "'r'": 0.16; 'backslash': 0.16; 'backslashes': 0.16; 'str()': 0.16; 'thread?': 0.16; 'prevent': 0.16; 'wrote:': 0.18; 'all,': 0.19; 'command': 0.22; 'header:User-Agent:1': 0.23; 'adds': 0.24; 'nearly': 0.26; 'second': 0.26; 'post': 0.26; 'header:In-Reply-To:1': 0.27; 'program,': 0.31; 'getting': 0.31; 'probably': 0.32; 'front': 0.32; 'raw': 0.33; 'problem': 0.35; 'subject: (': 0.35; 'but': 0.35; 'jason': 0.38; 'to:addr:python- list': 0.38; 'pm,': 0.38; 'short': 0.38; 'to:addr:python.org': 0.39; 'changed': 0.39; 'skip:u 10': 0.60; 'new': 0.61; 'simple': 0.61; "you're": 0.61; 'between': 0.67; 'line,': 0.68; 'received:74.208': 0.68; 'bailey': 0.84; 'isolate': 0.84; 'received:74.208.4.194': 0.84
Date Mon, 12 Jan 2015 15:17:08 -0500
From Dave Angel <davea@davea.name>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0
MIME-Version 1.0
To python-list@python.org
Subject Re: Python 3 regex woes (parsing ISC DHCPD config)
References <54B41073.30902@emerytelcom.com>
In-Reply-To <54B41073.30902@emerytelcom.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:/TGwuiKshGoUcIPQquKB+A2/1sYqe3aO4D9+fRqE0u4 atwaOjNJfOeuOS9JBefGwJ6j2NaYhZ5njgMjeq+GX7WB3ZYFr8 ljCmZ+ZVl+NF9dP7gOk2Bmvndfbt9N/CpWdc0DuiM8jCQsT4DW 4I1kIXx18bz4e1dNXZUR9u6aaRQfWeV1WHyPgyVr+VzByYGjsf qhlO/9D4YmuIfOe+TBeEn42JSHlV9ZZweksOlI9B5hfRBAGALl w86mDMou74TGxLRCBBbgi5GfYeuKEHpH3cuYKHsKKHoi1NB2T/ lgvNSJIFGqNDDGckBCKiiI3CavtIERD91q9mxJnZ4e2gJVTZjB fpJavFez2Rgula5iMxjY=
X-UI-Out-Filterresults notjunk:1;
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.17636.1421093841.18130.python-list@python.org> (permalink)
Lines 23
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1421093841 news.xs4all.nl 2935 [2001:888:2000:d::a6]:41365
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:83626

Show key headers only | View raw


On 01/12/2015 01:20 PM, Jason Bailey wrote:
> Hi all,
>

What changed between 1:03 and 1:20 that made you post a nearly identical 
second message, as a new thread?

>
> Unfortunately, I get no matches. From output on the command line, I can
> see that Python is adding extra backslashes to my re.compile string. I
> have added the raw 'r' in front of the strings to prevent it, but to no
> avail.
>

What makes you think that?  Please isolate this part of your problem 
with a simple short program, so we can diagnose it.  You're probably 
getting confused between str() and repr().  The latter adds backslash 
escape sequences for good reason, and if you don't understand it, you 
might think the strings are getting corrupted.


-- 
DaveA

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


Thread

Re: Python 3 regex woes (parsing ISC DHCPD config) Dave Angel <davea@davea.name> - 2015-01-12 15:17 -0500

csiph-web