Re: Help with Regular Expressions

2005-08-10 Thread Paul McGuire
The pyparsing distribution includes epydoc-generated class documentation, and a few example programs. Dave Kuhlman has a nice HOWTO at http://www.rexx.com/~dkuhlman/python_201/python_201.html#SECTION00760 Drop me a note if you are looking for some specific tips or techniques. (I'

Re: Help with Regular Expressions

2005-08-10 Thread Christopher Subich
Paul McGuire wrote: > If your re demands get more complicated, you could take a look at > pyparsing. The code is a bit more verbose, but many find it easier to > compose their expressions using pyparsing's classes, such as Literal, > OneOrMore, Optional, etc., plus a number of built-in helper func

Re: Help with Regular Expressions

2005-08-10 Thread Cappy2112
Be careful with that book though, it's RE examples are Perl-centric and not exactly the same implementation that Python uses. However, it's a good place to start This will also be useful http://www.amk.ca/python/howto/regex/ -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with Regular Expressions

2005-08-10 Thread Jeff Schwab
Harlin Seritt wrote: > I am trying to find some matches and have them put into a list when > processing is done. I'll use a simple example like email addresses. > > My input is the following: > wordList = ['myname1', '[EMAIL PROTECTED]', '[EMAIL PROTECTED]', > '[EMAIL PROTECTED]', '[EMAIL PROTECT

Re: Help with Regular Expressions

2005-08-10 Thread Paul McGuire
If your re demands get more complicated, you could take a look at pyparsing. The code is a bit more verbose, but many find it easier to compose their expressions using pyparsing's classes, such as Literal, OneOrMore, Optional, etc., plus a number of built-in helper functions and expressions, inclu

Re: Help with Regular Expressions

2005-08-10 Thread Benjamin Niemann
Harlin Seritt wrote: > Forgive another question here, but what is the 'r' for when used with > expression: r'\w+...' ? r'..' or r".." are "raw strings" where backslashes do not introduce an escape sequence - so you don't have to write '\\', if you need a backslash in the string, e.g. r'\w+' == '\

Re: Help with Regular Expressions

2005-08-10 Thread Harlin Seritt
Forgive another question here, but what is the 'r' for when used with expression: r'\w+...' ? -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with Regular Expressions

2005-08-10 Thread Harlin Seritt
Ahh that's it Frederik. That's what I was looking for. The regular expression problems I will take care of, but first wanted to walk before running. ;) Thanks, Harlin Seritt -- http://mail.python.org/mailman/listinfo/python-list

Re: Help with Regular Expressions

2005-08-10 Thread Fredrik Lundh
Harlin Seritt wrote: > I am trying to find some matches and have them put into a list when > processing is done. I'll use a simple example like email addresses. > > My input is the following: > wordList = ['myname1', '[EMAIL PROTECTED]', '[EMAIL PROTECTED]', > '[EMAIL PROTECTED]', '[EMAIL PROTECTE

Re: Help with Regular Expressions

2005-08-10 Thread Devan L
Harlin Seritt wrote: > I have been looking at the Python re module and have been trying to > make sense of a simple function that I'd like to do. However, no amount > of reading or googling has helped me with this. Forgive my > stone-headedness. I have done this with .NET and Java in the past but >

Help with Regular Expressions

2005-08-10 Thread Harlin Seritt
I have been looking at the Python re module and have been trying to make sense of a simple function that I'd like to do. However, no amount of reading or googling has helped me with this. Forgive my stone-headedness. I have done this with .NET and Java in the past but damn if I can't get it done wi