<?php
$str = "Ref ID =={1234} [201] (text message)";
preg_match_all("/[{|\[|\(](.*?)[\]|\)\}]/", $str, $matches);
var_dump($matches);
- Output for 7.1.0 - 7.1.21, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
- array(2) {
[0]=>
array(3) {
[0]=>
string(6) "{1234}"
[1]=>
string(5) "[201]"
[2]=>
string(14) "(text message)"
}
[1]=>
array(3) {
[0]=>
string(4) "1234"
[1]=>
string(3) "201"
[2]=>
string(12) "text message"
}
}
preferences:
145.61 ms | 408 KiB | 5 Q