Given an input string containing parentheses and other characters, implement a function that determines whether the parentheses in the string follow a valid pattern.
The function should return true if the parentheses are correctly nested and balanced; otherwise, it should return false.
Fork the challenge, write your solution, and test it against the provided test cases.
This is part of the Daily JavaScript Challenge series, aimed at improving programming skills and knowledge.