Are there any built-in PHP functions that could achieve the same result as the current regular expression?

The issue is that a regular expression is being used to extract a specific substring from a larger string. To achieve the same result without using a regular expression, we can utilize the `strpos()` and `substr()` functions in PHP. `strpos()` can be used to find the position of the starting delimiter, and `substr()` can then extract the desired substring based on the found positions.

$string = "This is a sample string with [substring] inside.";
$start_delimiter = "[";
$end_delimiter = "]";

$start_pos = strpos($string, $start_delimiter) + strlen($start_delimiter);
$end_pos = strpos($string, $end_delimiter, $start_pos);

$extracted_substring = substr($string, $start_pos, $end_pos - $start_pos);

echo $extracted_substring; // Output: substring