How to remove anything before a given character and anything after a given character with preg_replace using a regular expression? Of course this could be done in many other ways like explode and striping the string. But I am curious about preg_replace and regex.
So the only thing I need from the string below is 03b and remove every thing before/and slash (/) and after/and dot (.)
$string = 'rmbefore/03b.rmafter'
/and.?