Can anyone help me write a regex to filter the name between parenthesis in a string like this:
Aardal, Prof.dr.ir. K.I. (Karen)
preg_match('~[^/]([^/])~', $fullname, $matches);
0 => string 'Aa' (length=2)
1 => string 'a' (length=1)
(and any character besides
)is now the capture-group "name"
Tested with the tool Expresso. This regex matches two groups:
(?<name>...)is the named group
(etc. we have to escape it with a slash.