replacing regular expression in findPath