I want to copy a substring of a string using PHP.
The regex for the first pattern is /\d\|\d\w0:/
The regex for the second pattern is /\d\w\w\d+:\s-\s:/
Is it possible combining preg_match
with strpos
to get the exact positions from start to end and then copy it with:
substr( $string, $firstPos,$secPos ) ?