hi friends,
welll i currently work on a PERL-regEX that filters out the following data out of the dump of a ph ipBB that runs ths standard theme. After the regex i want to put the data into a database.
that is the hard task
but i begin with the beginning; i have to do some hard jobs on phpBB and i need to work with reg Expressions of Perl. Regex are a good way to help to filter out all the unnecessary parts of a page source.
so - lets start - ineed the regex of the following parts
[ this i have taken from the list http://www.phpbbdoctor.com/doc_tables.php ]
phpbb_categories Categories
phpbb_forums Forums for your board.
phpbb_groups A group of users
phpbb_posts Posts for your board.
phpbb_posts_text The text for the post
phpbb_topics Topics for your board.
phpbb_users Base user information, preference settings, and so on.
and the timestamp.
Code: /<td width="\d+" align="\w+" valign="\w+" class=".*"><span class="name"><a name="\d+"></a><b>(.*)</b></span><br /><span class="postdetails">Mitglied<br /><br /><br />Anmeldedatum: (.*)<br />Beiträge: (.*)<br />/
Subpattern 1 give the Username, Subpattern 2 the register-timestamp of the Users
pattern 3 gives back the number of posting.
Code: /\s+<td width="100%"><a href="viewtopic.php?p=\d+#\d+"><img src=".*"
width="\d+" height="\d+" alt="Beitrag" title="Beitrag" border="\d+" /></a><span class="postdetails">Verfasst am: (.*)<span class="gen"> </span> Titel:
(.*)</span></td>/
Subpattern 1 gives time of composing Nr2 gives the title
waht about Metacharacters & the others they have to get tracked down with Backslash
^ $ + ? . * ( ) [ ] { } / \ |
HTML/PHP Code has to be taken away - how look forward to hear from you
well after wards the code should go in to a database.
what do you think? Pleas let me know!
ths
bernard