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.

combining string matches

Help for those learning Tcl or writing their own scripts.
Post Reply
User avatar
NewzNZ
Halfop
Posts: 68
Joined: Thu Mar 05, 2009 5:15 am
Contact:

combining string matches

Post by NewzNZ »

Hi all

Just wondering if there's a way to combine these string matches into a shorter operation?

Code: Select all

	if {[string match *href* $n] || [string match *http* $n] || [string match *@* $n]} {
Thanks in advance for any help!
User avatar
caesar
Mint Rubber
Posts: 3778
Joined: Sun Oct 14, 2001 8:00 pm
Location: Mint Factory

Post by caesar »

Regexp?

Code: Select all

if {[regexp {href|http|@} $n]} {
Once the game is over, the king and the pawn go back in the same box.
Post Reply