nope, there i used *those expressions* to split the url entered apart to
~domain (hostname, before first / symbol, e.g.
www.tek-tips.com)
~pathname (here it would be just
/)
~filename (
viewthread.cfmblabla)
Code:
var _pat1=/([^\/]*)(\/.*)*/
var parts={
_hostname : url.match(_pat1)[1],
_pathname : url.match(_pat1)[2],
_patharr : url.match(_pat1)[2].split("/"),
_file : ""
}
var _temp=parts._patharr
parts._file=_temp[_temp.length-1]
_temp.length--;
parts._pathname=(_temp.length==1) ? "/" : _temp.join("/")
//alert("there are\nhostname: "+parts._hostname+"\npathname: "+parts._pathname+"\nfile: "+parts._file)
some explanations:
var _pat1=/([^\/]*)(\/.*)*/ - a pattern, first brackets matches everything before first
/, second - everything else..
url.match(_pat1) - this catches matches of entered url with given pattern, if assigned to a variable (like in my case) it returns an array of matches (the length of array equals to the amount of bracket-qroups [2 in this case] & numbering starts from
1, but not from 0)
so,
url.match(_pat1)[1] would catch the first match (meaning hostname) & second - (blabla[2]) - the second match (pathname)
then i split that pathname by "/" & the last value in resulting array is a filename; i qrab it outta here & join the rest to the
"_pathname" variable
blabla (tired explaining)
and so on..
what can i say? i guess it is too complicated.. but i like to write things that might be used in many ways

Victor