greedy match wanted

2005-03-03 Thread alexk
Hi,

I would like to request your help.

My problem is as follows. I want to match urls, and therefore I have a
group
of long valid domain names in my regex:

 (?:com|org|net|biz|info|ac|cc|gs|ms|
 sh|st|tc|tf|tj|to|vg|ad|ae|af|ag|
 com\.ag|ai|off\.ai|al|an|ao|aq|
 com\.ar|net\.ar|org\.ar|as|at|co\.at| ... ) ...

However, for a url like kuku.com.to it matches the kuku.com part,
while I want it to match the whole kuku.com.to. Notice that both "com"
and "com.to" are present in the group above.

1. How do I give precedence for "com.to" over "com" in the above group
?
Maybe I can somehow sort it by lexicographic order and then by length,
or divide it to a set of sub-groups by length ?

Thanks for any help,
Alex.

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: greedy match wanted

2005-03-04 Thread alexk
Thanks, I'll try your solution.
Alex.

-- 
http://mail.python.org/mailman/listinfo/python-list


split question

2005-04-28 Thread alexk
I've a simple question. Why the following:

words = "[EMAIL PROTECTED]@^%[wordA] [EMAIL PROTECTED]".split('[EMAIL 
PROTECTED]&*()_+-=[]{},./')

doesn't work? The length of the result vector is 1.

I'm using ActivePython 2.4

Alex

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: split question

2005-04-28 Thread alexk
Yes, all of you are right. Thank you all for your answers - I'll use a
regex.

-- 
http://mail.python.org/mailman/listinfo/python-list


pydoc for global variables

2005-05-15 Thread alexk
Hi,
Is it possible to "pydoc" global variables also ?
It just stucks them into the "DATA" section.

Thanks, Alex

-- 
http://mail.python.org/mailman/listinfo/python-list