[Zarutian] 29. desember 2006 (UTC): I am not quite understanding the spec http://openid.net/specs/openid-authentication-1_1.html [Zarutian] 00:00 29. desember 2006 (UTC): Starting of an OpenID consumer package [Zarutian] 22:49 30. desember 2006 (UTC): I cant figure out why the regexp's dont work propperly. package require http proc geturl {url} { if {![regexp {^http://.*} $url]} { set url "http://[set url]" } set token [http::geturl $url] set ncode [http::ncode $token] if {($ncode == "301") || ($ncode == "302")} { # an redirect upvar #0 $token state if {![info exists state(meta)]} { error } array set meta $state(meta) if {![info exists meta(Location)]} { error } return [geturl $meta(Location)] } set data [http::data $token] http::cleanup $token return $data } proc find_openid.server {input} { # if {[regexp {.*.*} $input dummy server]} { return $server } else { return {} } } proc find_openid.delegate {input} { # if {[regexp {.*.*} $input dummy delegate]} { return $delegate } else { return {} } } proc openid_checkid_immediate {url} { set stuff [geturl $url] puts "openid server = [find_openid.server $stuff]" puts "openid delegate = [find_openid.delegate $stuff]" } CJL - Which regexps are causing problems? I'm going to assume the first one is OK, but the ones in find_openid.server and find_openid.delegate aren't. Firstly, there's no need to match the text before and after the section of interest. Secondly '.*' is greedy - it will match as much as possible (i.e. it will match up to the LAST '>' in the input string, rather than just as far as the next one). To ask for the minimal match, use '.*?' instead, although I have found that doesn't always behave as I'd expect it to. In general, I'd say try to avoid the combination of '.*' if you can, and in this case it works if you match 'any number of non-quote characters'. In summary, I think your patterns should be more like: regexp {