<?php $target = 'https://example.com/[photo-s]/photo.jpg'; $result = preg_replace('/\[photo-[a-z]+]/', 'somethingElse', $target); var_dump($result);
You have javascript disabled. You will not be able to edit any code.