Danny Yoo wrote:
[Windows bashing cut]
Python's support for Windows stuff is actually quite good, thanks to the
work of Mark Hammond:
http://starship.python.net/crew/mhammond/
A lot of us here do use Windows for COM programming. Let's get back to
talking about Python programming and let's help
But I only want to ignore B if A is a match. If A is not a match,
I'd like it to advance on to B.
On Mar 9, 2005, at 12:07 PM, Marcos Mendonça wrote:
Hi
Not and regexp expert. But it seems to me that if you want to ignora
B then it should be
(A) | (^B)
Hope it helps!
On Wed, 9 Mar 2005 11:11:57
Actually, you should get that anyway...
|
Alternation, or the ``or'' operator. If A and B are regular
expressions, A|B will match any string that matches either A or B.
| has very low precedence in order to make it work reasonably when
you're alternating multi-character strings. Crow|Servo
but yeah, it
seems you're expecting it to examine the string as a whole.
I guess I was, good point.
On Mar 9, 2005, at 12:28 PM, Liam Clarke wrote:
Actually, you should get that anyway...
|
Alternation, or the ``or'' operator. If A and B are regular
expressions, A|B will match any string
import os.path
print os.path.expanduser('~/memo.txt')
C:\Documents and Settings\Administrator/memo.txt
f = open(os.path.expanduser('~/memo.txt'))
Traceback (most recent call last):
File pyshell#15, line 1, in ?
f = open(os.path.expanduser('~/memo.txt'))
IOError: [Errno 2]
Mike Hall wrote:
A simple example will show what I mean:
import re
x = re.compile(r(A) | (B))
s = X R A Y B E
r = x.sub(13, s)
print r
X R 13Y13 E
...so unless I'm understanding it wrong, B is supposed to be ignored
if A is matched, yet I get both matched. I get the same result if I
[EMAIL PROTECTED] wrote:
import os.path
print os.path.expanduser('~/memo.txt')
C:\Documents and Settings\Administrator/memo.txt
f = open(os.path.expanduser('~/memo.txt'))
Traceback (most recent call last):
File pyshell#15, line 1, in ?
f =
Thanks to Sean and Kent for replies. I found a site that provided some
good examples, too, at
http://www.cafepy.com/articles/python_attributes_and_methods/
ch03s02.html
Here's a blurb from the title page:
wep page excerpt
Shalabh Chaturvedi
Copyright © 2004 Shalabh Chaturvedi
This book
mmm ... I kind of see what you mean.
Does anyone have like a realy large shovel so I can dig a hole and hide ?
No worries, we've all been there before. Sometimes you just can't see
what's right in front of your face.
Don't let it stop you, or stop you from asking questions.
Peace
Bill Mill