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 n00b

Old posts that have not been replied to for several years.
Locked
d
durandal

Regexp n00b

Post by durandal »

alright im new to the regexp command, what im trying to do, is take the following string "(hello) (this) is.my.test.string-hehe (ok)" and make regexp match and take out only the "is.my.test.string-hehe" however im sort of stuck =\

my current script:
set word1 "(hello) (this) is.my.test.string-hehe (ok)"
if {[regexp {([^]+\.[^]+)} $word1 {} dottedstring]} {
echo "dottedstring is: $dottedstring"
}

Its not matching correctly and I could use some help =|
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Looks like you just forgot the spaces?

regexp {([^ ]+\.[^ ]+)} $word} ign dottedstring
Locked