Why not just s/ .*//
Good idea. It should also do the trick. There are semi-pathological edge cases where the filename contains a space, for which this might trip it up. Okay, with the other solutions I proposed, there are sick and perverted edgecases where the filename has not only a space, but "pre=" in it too, e.g. "file pre=2.txt"
Caveat regextor. :) -tim
