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.

regexp help please [SOLVED]

Help for those learning Tcl or writing their own scripts.
Post Reply
N
NTHosts
Op
Posts: 100
Joined: Mon Oct 10, 2005 9:57 pm
Location: UK
Contact:

regexp help please [SOLVED]

Post by NTHosts »

I have this regexp

Code: Select all

regexp { <td height="39" valign="top" id="description"><font color="white" face="verdana" size="2">(.*) - this txt changes </font></tr>} $topic1 - djnick
the problem I have is the bit that says 'this txt changes' does change often, so of course the regexp dosnt' work, how would I regsub (if thats right) that out ?
Last edited by NTHosts on Wed Jun 28, 2006 7:54 am, edited 1 time in total.
www.NT-Hosts.Net - More than just a host
User avatar
De Kus
Revered One
Posts: 1361
Joined: Sun Dec 15, 2002 11:41 am
Location: Germany

Post by De Kus »

you can use something like
[A-Za-z ]+?
to match the smallest text possible, but of any content.
De Kus
StarZ|De_Kus, De_Kus or DeKus on IRC
Copyright © 2005-2009 by De Kus - published under The MIT License
Love hurts, love strengthens...
N
NTHosts
Op
Posts: 100
Joined: Mon Oct 10, 2005 9:57 pm
Location: UK
Contact:

but...

Post by NTHosts »

Would I add that to a regsub.. if so how would that look, or do I just add that to the regexp I have already ?
www.NT-Hosts.Net - More than just a host
m
metroid
Owner
Posts: 771
Joined: Wed Jun 16, 2004 2:46 am

Post by metroid »

Code: Select all

regexp { <td height="39" valign="top" id="description"><font color="white" face="verdana" size="2">(.*) - .*</font></tr>} $topic1 - djnick
Maybe something like that? Assuming the - is the seperator.
N
NTHosts
Op
Posts: 100
Joined: Mon Oct 10, 2005 9:57 pm
Location: UK
Contact:

wewt

Post by NTHosts »

Yep that worked perfect, thanks :D:D:D
www.NT-Hosts.Net - More than just a host
Post Reply