For example i have some plain text.
Tintin in Tibet is the s:20 volume of The Adventures of Tintin, the comics series by Belgian cartoonist Hergé. The cartoonist considered it his favourite Tintin adventure and an emotional effort, as he created it while suffering from traumatic nightmares and a personal conflict while deciding to leave his wife of s:3 decades for a younger woman.
What i need is to convert specific custom links in text to clickable links, using number after colon. (s:number)
So the s:10 would convert to http://somepage.com/demo.php?num=10
In this case:
$text = "Tintin in Tibet is the s:20 volume of The Adventures of Tintin.";
The idea here is probably searching for specific form of string using regex and replacing it with the exploded (extracting the number) and modified (converting to link) version of itself, but i am not really good with regex and have no idea how to do this in practice.
Also, what would be the fastest option, when you have many instances of replaceable strings throughout the text?