php regex markdown link

Solutions on MaxInterview for php regex markdown link by the best coders in the world

showing results for - "php regex markdown link"
Martina
23 Mar 2020
1$text = 'Link to [Google](https://www.google.com/)';
2echo preg_replace('/\[(.*?)\]\s*\(((?:http:\/\/|https:\/\/)(?:.+))\)/', '<a href="$2">$1</a>', $text);
3// Outputs: Link to <a href="https://www.google.com/">Google</a>
similar questions
queries leading to this page
php regex markdown link