Alessandro Marino wrote:
I'm a beginner and I was trying to write a program to
parse recursively all file names in a directory specified as parameter.
The problem is that I get a "None" printed to stdout when a file is
positively matched. While when the file name doesn't match the regexp
the o
On Sun, 21 Mar 2010 19:12:18 +0100, Alessandro Marino wrote:
> Could anyone help me to figure out why "None" appears in the putput?
I get:
"Attachment not shown: MIME type application/octet-stream; filename a.py"
Posting attachments to Usenet is tricky. Many newsgroups filter out
anything they
I'm a beginner and I was trying to write a program to parse recursively all
file names in a directory specified as parameter. The problem is that I get
a "None" printed to stdout when a file is positively matched. While when the
file name doesn't match the regexp the output seems ok.
C:\>c:\python
MRAB wrote:
Ethan Furman wrote:
Marcus Wanner wrote:
Wow, I really need to learn more about regexp...
Any tutorials you guys can recommend?
Marcus
Mastering Regular Expressions
Powerful Techniques for Perl and Other Tools
By Jeffrey E. F. Friedl
Great book!
+1
I have the first edition,
Ethan Furman wrote:
Marcus Wanner wrote:
On 7/30/2009 9:32 AM, Beldar wrote:
On 30 jul, 15:07, MRAB wrote:
Beldar wrote:
Hi there!
I have a problem and i'm not very good at regular expressions.
I have a text like "lalala lalala tiruri beldar-is-listening tiruri
lalala" I need a regexp to
Marcus Wanner wrote:
On 7/30/2009 9:32 AM, Beldar wrote:
On 30 jul, 15:07, MRAB wrote:
Beldar wrote:
Hi there!
I have a problem and i'm not very good at regular expressions.
I have a text like "lalala lalala tiruri beldar-is-listening tiruri
lalala" I need a regexp to get the 'beldar' part
Marcus Wanner writes:
> On 7/30/2009 9:32 AM, Beldar wrote:
>> On 30 jul, 15:07, MRAB wrote:
>>> Beldar wrote:
Hi there!
I have a problem and i'm not very good at regular expressions.
I have a text like "lalala lalala tiruri beldar-is-listening tiruri
lalala" I need a regexp
On 7/30/2009 9:32 AM, Beldar wrote:
On 30 jul, 15:07, MRAB wrote:
Beldar wrote:
Hi there!
I have a problem and i'm not very good at regular expressions.
I have a text like "lalala lalala tiruri beldar-is-listening tiruri
lalala" I need a regexp to get the 'beldar' part, the format is
'somethin
On 30 jul, 15:07, MRAB wrote:
> Beldar wrote:
> > Hi there!
>
> > I have a problem and i'm not very good at regular expressions.
> > I have a text like "lalala lalala tiruri beldar-is-listening tiruri
> > lalala" I need a regexp to get the 'beldar' part, the format is
> > 'something-is-listening',
Beldar wrote:
Hi there!
I have a problem and i'm not very good at regular expressions.
I have a text like "lalala lalala tiruri beldar-is-listening tiruri
lalala" I need a regexp to get the 'beldar' part, the format is
'something-is-listening', i need to get the something part, use it in
my code
I have a problem and i'm not very good at regular expressions.
I have a text like "lalala lalala tiruri beldar-is-listening tiruri
lalala" I need a regexp to get the 'beldar' part, the format is
'something-is-listening', i need to get the something part, use it in
my code, and then replace the who
Hi there!
I have a problem and i'm not very good at regular expressions.
I have a text like "lalala lalala tiruri beldar-is-listening tiruri
lalala" I need a regexp to get the 'beldar' part, the format is
'something-is-listening', i need to get the something part, use it in
my code, and then repla
On Aug 3, 10:41 pm, Ehsan <[EMAIL PROTECTED]> wrote:
...
> what can I do? what's wrong whit this pattern? thanx for your comments
Nothing. There's something wrong with the code you are using the regex
with. Post it and we may be able to help. Like Lawrence has said, it's
likely to be that you are
In message <[EMAIL PROTECTED]>, Ehsan
wrote:
> I use this pattern :
> "http.*?\.(wmv|3gp).*""
>
> but it returns only 'wmv' and '3gp' instead of "http://www.2shared.com/
> download/1716611/e2000f22/Jadeed_Mlak14.wmv?
> tsid=20070803-164051-9d637d11"
What's the actual Python code that uses this r
On 4 A ustos, 17:10, Ehsan <[EMAIL PROTECTED]> wrote:
> On Aug 4, 1:22 pm, Sönmez Kartal <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
>
>
> > On 4 A ustos, 00:41, Ehsan <[EMAIL PROTECTED]> wrote:
>
> > > I want to find "http://www.2shared.com/download/1716611/e2000f22/
> > > Jadeed_Mlak14.wmv?tsid=20070803
Il Fri, 03 Aug 2007 14:41:52 -0700, Ehsan ha scritto:
maybe you can use this to solve your prob:
myurl = "http://www.2shared.com/download/1716611/e2000f22/
Jadeed_Mlak14.wmv?tsid=20070803-164051-9d637d11"
if myurl.startswith('http') and ('wmv' in myurl or '3pg' in myurl):
# myurl is the
On Aug 4, 1:22 pm, Sönmez Kartal <[EMAIL PROTECTED]> wrote:
> On 4 A ustos, 00:41, Ehsan <[EMAIL PROTECTED]> wrote:
>
>
>
>
>
> > I want to find "http://www.2shared.com/download/1716611/e2000f22/
> > Jadeed_Mlak14.wmv?tsid=20070803-164051-9d637d11" or 3gp instead of
> > wmv in the text file like t
On 4 A ustos, 00:41, Ehsan <[EMAIL PROTECTED]> wrote:
> I want to find "http://www.2shared.com/download/1716611/e2000f22/
> Jadeed_Mlak14.wmv?tsid=20070803-164051-9d637d11" or 3gp instead of
> wmv in the text file like this :
>
> ""some code""
> function reportAbuse() {
> var windowname="abus
On Aug 4, 1:36 am, Dave Hansen <[EMAIL PROTECTED]> wrote:
> On Aug 3, 4:41 pm, Ehsan <[EMAIL PROTECTED]> wrote:
>
> > I want to find "http://www.2shared.com/download/1716611/e2000f22/
> [...]
> > I use this pattern :
> > "http.*?\.(wmv|3gp).*""
>
> > but it returns only 'wmv' and '3gp' instead of "
On Aug 3, 4:41 pm, Ehsan <[EMAIL PROTECTED]> wrote:
> I want to find "http://www.2shared.com/download/1716611/e2000f22/
[...]
> I use this pattern :
> "http.*?\.(wmv|3gp).*""
>
> but it returns only 'wmv' and '3gp' instead of "http://www.2shared.com/
> download/1716611/e2000f22/Jadeed_Mlak14.wmv?
>
I want to find "http://www.2shared.com/download/1716611/e2000f22/
Jadeed_Mlak14.wmv?tsid=20070803-164051-9d637d11" or 3gp instead of
wmv in the text file like this :
""some code""
function reportAbuse() {
var windowname="abuse";
var url="/abuse.jsp?link=" + "http://www.2shared.com/file/17
Johny wrote:
> I have the following text
>
> Goods Item 146 (174459989) - OurWebSite
>
> from which I need to extract
> `Goods Item 146 '
>
> Can anyone help with regexp?
> Thank you for help
> L.
In general, parsing HTML with regular expressions is a bad idea.
Usually, you use somethin
On Mar 22, 3:26 am, "Johny" <[EMAIL PROTECTED]> wrote:
> I have the following text
>
> Goods Item 146 (174459989) - OurWebSite
>
> from which I need to extract
> `Goods Item 146 '
>
> Can anyone help with regexp?
> Thank you for help
> L.
Here's the immediate answer to your question.
import r
Johny a écrit :
> I have the following text
>
> Goods Item 146 (174459989) - OurWebSite
>
> from which I need to extract
> `Goods Item 146 '
>
> Can anyone help with regexp?
Sure : the documentation is here:
http://docs.python.org/lib/module-re.html
And there's a nice tutorial here:
http:/
On Thu, Mar 22, 2007 at 01:26:22AM -0700, Johny wrote:
> I have the following text
>
> Goods Item 146 (174459989) - OurWebSite
>
> from which I need to extract
> `Goods Item 146 '
>
> Can anyone help with regexp?
> Thank you for help
> L.
(Goods\s+Item\s+146\s+)
--
Zeng Nan
MY
I have the following text
Goods Item 146 (174459989) - OurWebSite
from which I need to extract
`Goods Item 146 '
Can anyone help with regexp?
Thank you for help
L.
--
http://mail.python.org/mailman/listinfo/python-list
Zeng Nan wrote:
> On Thu, Mar 22, 2007 at 01:26:22AM -0700, Johny wrote:
>> I have the following text
>>
>> Goods Item 146 (174459989) - OurWebSite
>>
>> from which I need to extract
>> `Goods Item 146 '
>>
>> Can anyone help with regexp?
>> Thank you for help
>> L.
>
> (Goods\s+Item\s+146\s+)
Hi,
I have a problem which I believe is seen before:
Finding the correct pattern to use, in order to split a line correctly,
using the split function in the re module.
I'm new to regexp, and it isn't always easy to comprehend for a newbie :)
The lines I want to split are like this:
(The followin
Hans Almåsbakk wrote:
> Is there a relatively hassle-free way to get the csv module working with
> 2.1? The server is running Debian stable/woody, and it also seemed 2.2 can
> coexist with 2.1, when I checked the distro packages, if that is any help.
2.3 and 2.4 can also coexist with 2.1 (use "ma
"Fredrik Lundh" <[EMAIL PROTECTED]> writes:
> >>> import csv
>
> http://online.effbot.org/2003_08_01_archive.htm#librarybook-csv-module
>
This seems be just the thing I need.
Now ofcourse, another problem arouse:
The csv module is new in Python 2.3.
hans:~# python -V
Python 2.1.3
Is there a
Hans Almåsbakk (14.12.2004 16:02):
Any pointer will be greatly appreciated. Maybe I'm attacking this problem
the wrong way already from the start? (Not that I can see another way
myself :)
Hans, did you try the csv module in the Python library?
Matthias
--
http://mail.python.org/mailman/listinfo/py
Hans Almåsbakk wrote:
> These lines are in a csv file exported from excel.
> Any pointer will be greatly appreciated. Maybe I'm attacking this problem
> the wrong way already from the start? (Not that I can see another way
> myself :)
>>> import csv
http://online.effbot.org/2003_08_01_archive.h
32 matches
Mail list logo