On Mon, 26 Feb 2007 08:01:07 +0100 Emmanuel <emmanuel at quomodo.com> wrote: > var s = "http://www.mydomain.com/firstdir/secondir/myfile.txt"; > s = s.replace ( /.*\// , "" ) fwiw: you might actually need to do something else with the source string, so maybe this: var s = "http://www.mydomain.com/firstdir/secondir/myfile.txt"; var f = s.replace ( /.*\// , "" ); ...would be more conservative?