This usually is a job for a Regular Expression.
Some Links that might be helpful: MDN, RegExr - a playground, a recent post to a similar topic.
This usually is a job for a Regular Expression.
Some Links that might be helpful: MDN, RegExr - a playground, a recent post to a similar topic.