As programmer I need to filter, search and validate data every day. For all those problems I need to decide if I use a regular expression or plain php.
Even in a simple example like here I think it is not clear what to use:
How to write a regex expression that replace anchors and links value
The main advantage of using regexes is that is short but therefore you lose a lot of readability.
Is there an best practices way?
Can the input be expressed in a regular grammar? If so, use regular expression else you’ll need to build a parser to handle it.