This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

Another regexp that ain`t working :-/

Help for those learning Tcl or writing their own scripts.
Post Reply
o
overfly
Voice
Posts: 8
Joined: Fri Jan 07, 2005 6:02 am

Another regexp that ain`t working :-/

Post by overfly »

Hi everybody out there. I pharse a html Page with the following html Code:
<div class="deat"><div class="thl">Test1</div><table width="100%"><tr><td class="time">Test2</td><td class="hl">Test3</td></tr></table>
<div class="txt">Test4</div></div>
<div class="deat"><div class="thl">Test1</div><table width="100%"><tr><td class="time">Test2</td><td class="hl">Test3</td></tr></table>
<div class="txt">Test4</div></div>
<div class="deat"><div class="thl">Test1</div><table width="100%"><tr><td class="time">Test2</td><td class="hl">Test3</td></tr></table>
<div class="txt">Test4</div></div>
Now i have in my tcl following code:
regexp {<div class="deat"><div class="thl">(.*)</div><table width="100%"><tr><td class="time">(.*)</td><td class="hl">(.*)</td></tr></table>} $content . time1 time2 time3
regexp{<div class="txt">(.*)</div></div>} $content . main1
The thing is, that i need this working, only for the first 2 Lines :-/
After 48hours of showing me that i have to learn a lot more of tcl i need your help.
THX
Greetz
overfly
User avatar
Sir_Fz
Revered One
Posts: 3794
Joined: Sun Apr 27, 2003 3:10 pm
Location: Lebanon
Contact:

Post by Sir_Fz »

If $content is a list, then use [lindex $content 0] and [lindex $content 1] for the 1st and 2nd lines.
Post Reply