Re: Regular expression to structure HTML

2009-10-04 Thread Stefan Behnel
504cr...@gmail.com wrote: > No -- sorry -- I don't want to use BeautifulSoup (though I have for > other projects). Humor me, please -- I'd really like to see if this > can be done with just regular expressions. I think the reason why people are giving funny comments here is that you failed to prov

Re: Regular expression to structure HTML

2009-10-04 Thread Nobody
On Thu, 01 Oct 2009 22:10:55 -0700, 504cr...@gmail.com wrote: > I'm kind of new to regular expressions The most important thing to learn about regular expressions is to learn what they can do, what they can't do, and what they can do in theory but can't do in practice (usually because of exponent

Re: Regular expression to structure HTML

2009-10-03 Thread 504cr...@gmail.com
On Oct 2, 11:14 pm, greg wrote: > Brian D wrote: > > This isn't merely a question of knowing when to use the right > > tool. It's a question about how to become a better developer using > > regular expressions. > > It could be said that if you want to learn how to use a > hammer, it's better to pr

Re: Regular expression to structure HTML

2009-10-02 Thread greg
Brian D wrote: This isn't merely a question of knowing when to use the right tool. It's a question about how to become a better developer using regular expressions. It could be said that if you want to learn how to use a hammer, it's better to practise on nails rather than screws. -- Greg --

Re: Regular expression to structure HTML

2009-10-02 Thread 504cr...@gmail.com
Screw: >>> html = """ 14313 Python Hammer Institute #2 Jefferson 70114 8583 New Screwdriver Technical Academy, Inc #4 Jefferson 70114 9371 Career RegEx Center Jefferson

Re: Regular expression to structure HTML

2009-10-02 Thread Brian D
The other thought I had was that I may not be properly trapping the end of the first row, and the beginning of the next row. On Oct 2, 8:38 am, John wrote: > On Oct 2, 1:10 am, "504cr...@gmail.com" <504cr...@gmail.com> wrote: > > > > > I'm kind of new to regular expressions, and I've spent hou

Re: Regular expression to structure HTML

2009-10-02 Thread Brian D
Yes, John, that's correct. I'm trying to trap and discard the row elements, re-formatting with pipes so that I can more readily import the data into a database. The tags are, of course, initially useful for pattern discovery. But there are other approaches -- I could just replace the tags and cap

Re: Regular expression to structure HTML

2009-10-02 Thread John
On Oct 2, 1:10 am, "504cr...@gmail.com" <504cr...@gmail.com> wrote: > I'm kind of new to regular expressions, and I've spent hours trying to > finesse a regular expression to build a substitution. > > What I'd like to do is extract data elements from HTML and structure > them so that they can more

Re: Regular expression to structure HTML

2009-10-02 Thread Stefan Behnel
Paul McGuire wrote: > On Oct 2, 12:10 am, "504cr...@gmail.com" <504cr...@gmail.com> wrote: >> I'm kind of new to regular expressions, and I've spent hours trying to >> finesse a regular expression to build a substitution. >> >> What I'd like to do is extract data elements from HTML and structure >>

Re: Regular expression to structure HTML

2009-10-02 Thread Paul McGuire
On Oct 2, 12:10 am, "504cr...@gmail.com" <504cr...@gmail.com> wrote: > I'm kind of new to regular expressions, and I've spent hours trying to > finesse a regular expression to build a substitution. > > What I'd like to do is extract data elements from HTML and structure > them so that they can more

Re: Regular expression to structure HTML

2009-10-02 Thread Bruno Desthuilliers
504cr...@gmail.com a écrit : I'm kind of new to regular expressions, and I've spent hours trying to finesse a regular expression to build a substitution. What I'd like to do is extract data elements from HTML and structure them so that they can more readily be imported into a database. No -- so

Regular expression to structure HTML

2009-10-01 Thread 504cr...@gmail.com
I'm kind of new to regular expressions, and I've spent hours trying to finesse a regular expression to build a substitution. What I'd like to do is extract data elements from HTML and structure them so that they can more readily be imported into a database. No -- sorry -- I don't want to use Beau