Yes, performance issue is a problem. I will check the regex that make the function be more effective