I have strings containing this (where the number are integers representing the user id)
@[calbert](3)
@[username](684684)
I figured I need the following to get the username and user id
\((.*?)\)
and
\[(.*?)])
But is there a way to get both at once?
And PHP returns, is it possible to only get the result without the parenthesis (and brackets in the username case)
Array
(
[0] => (3)
[1] => 3
)
preg_match_all()and theregexsyntax.