f*cking re module

Gustavo Niemeyer gustavo at niemeyer.net
Tue Jul 5 13:09:39 EDT 2005


> To reply to the last part of the discussion and esspecially to Gustavo
> Niemeyer, I really apriciate the way in which I had been answered. And
> I won't have any questions about the re module that I had before I
> post this threat.

Great! As I said, that's a nice news group.

> I was frustration and should, probebly, not post this frustration. But
> it was never my purpous to ask something stupid or asking it arrogant.

You can post frustration for sure. But saying "f*cking re module"
and than showing that your problem is not understanding the very
basics of regular expressions is not a nice way to ask for help.

> The python re module is, in my opinion, a non beginner user friendly
> module. And it's not meant for beginning python programmers. I don't
> have any experience with perl or related script/programming languages
> like python. (I prefer to do things in c) So the re module is
> completely new for me.

  >>> re.match("<p>(.*)</p>", "<p>foobar</p>").group(1)
  'foobar'

That's very similar to your problem and looks quite clear and
simple, but you must understand what regular expressions are
about, of course.

> If I upset someones clean mind posting a "stupid" and "arrogant"
> question, I'm sorry and won't post my frustrasion on this usenet group
> anymore.

Not upset at all. You just asked it the wrong way, and I was impressed
that even then there were lots of people to help you. That's not
usual in most places.

> But thank you for all your help about the re module,

In my opinion you would benefit from looking at some documentation
talking about regular expressions in general. After you understand
them, the re module will look f*cking simple. ;-)

-- 
Gustavo Niemeyer
http://niemeyer.net



More information about the Python-list mailing list