Changed regexp to reduce errors

The old regexp allowed for URLs without trailing slashes, so an error occurs when "bookmark.php" is appended to the URL when the final slash is missing.