| View previous topic :: View next topic |
| Author |
Message |
overfly Voice
Joined: 07 Jan 2005 Posts: 8
|
Posted: Sun Feb 12, 2006 6:31 am Post subject: Another regexp that ain`t working :-/ |
|
|
Hi everybody out there. I pharse a html Page with the following html Code:
| Quote: | <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:
| Quote: | 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 |
|
| Back to top |
|
 |
Sir_Fz Revered One

Joined: 27 Apr 2003 Posts: 3793 Location: Lebanon
|
Posted: Sun Feb 12, 2006 10:44 am Post subject: |
|
|
If $content is a list, then use [lindex $content 0] and [lindex $content 1] for the 1st and 2nd lines. _________________ Follow me on GitHub
- Opposing
Public Tcl scripts |
|
| Back to top |
|
 |
|