<?php
$modules = [
'node',
'system',
'my_module_library',
'my_module',
'my1_module',
'my_module_with_prefix',
];
preg_match_all('<#' . implode('[^#]+|#', $modules) . '[^#]+#>', '#' . implode('#', $modules) . '#', $matches);
var_dump($matches);
- Output for 8.1.32, 8.2.0 - 8.2.29, 8.3.0 - 8.3.26, 8.4.1 - 8.4.13
- array(1) {
[0]=>
array(2) {
[0]=>
string(18) "#my_module_library"
[1]=>
string(22) "#my_module_with_prefix"
}
}
preferences:
54.95 ms | 406 KiB | 5 Q