I'm doing a simple excercise in reading a file, and printing each line.
However, I'm getting this error. The file is a windows txt file, ecoded in
ANSI(ascii). I don't understand why Pythin is displaying a Unicode error.
Here is my script:
f=open('I:\\PythonScripts\\statement.txt')
for line
My regex is being run in both Python v2.6 and v3.1
For this example, I'll give one line. This lines will be read out of log
files. I'm trying to get the GUID for the User ID to query a database with
it, so I'd like a sub match. Here is the code
-
import re
line = '>Checking Priv
Thanks! The ? got rid of the greediness!
vince spicer wrote:
>
> On Wed, Jul 29, 2009 at 11:35 AM, gpo wrote:
>
>
> your grouping (.+) appears to be greedy, you can make it non-greedy with a
> question mark
>
> EX:
>
> pUserID=re.compile('
Thanks for the replies in the last thread. I'm still trying to figure out
how Python is handling RegEx. I'm converting my thoughts from Perl (the
mother of regex) to Python, and expect the same results. Why are they
different?
Perl:
$line='>Checking Privilege for UserId:
{874BE70A-194B-DE11-BE