regsub -all "\n" $html "" html
set nopage [string first "<div id=date>" $html 0]
set news [string range $html $nopage [expr [string first "<ul>" $html $nopage] - 1]]
<div id=tanggal>
Tuesday ,
27/09/2005 09:11 EST</div>
Today news is bla bla bla bla. </a></div>
<div id=summary>
Bla bla bla bla bla news today. </div>
<div id=titlebiru>Read also :</div>
<ul>
How to regexp the date, news topic, and the news? into $variable, so the output will be:
Tuesday, 27/09/2005 09:11 EST, Today news is bla bla bla. Bla bla bla bla news today.
I'd suggest to run a regexp on the complete html without string range and regsub changes.
if you are too unfamilar with regexpand dont want to link to the complete page I'd recommned you to try out this one: http://forum.egghelp.org/viewtopic.php?t=9972
Tip: use '[^>]' or '[^<]' instead of '.' in cases where <tag> </tag> is not unique, because regex tends to match the widest match, not the shortest match.
De Kus wrote:Tip: use '[^>]' or '[^<]' instead of '.' in cases where <tag> </tag> is not unique, because regex tends to match the widest match, not the shortest match.
there's no need of that, '*?' is a non-greedy quantifier, see the docs
connection, sharing, dcc problems? click <here>
before asking for scripting help, read <this>
use