I'm trying to find a string inside curly braces that can appear in many variations.
i.e. In the following string i'm searching for the word Link
asdasd{Link1111:TAG}\r\n {TAG:Link2sds}
I'm using the following command: $pattern = "/{(Link.*?)}|{(.*Link.*?)}/";
and the result is:
{array} [3]
0 => {array} [2]
0 = "{Link1:TAG}"
1 = "{TAG:Link2}"
1 = {array} [2]
0 = "Link1:TAG"
1 = ""
2 = {array} [2]
0 = ""
1 = "TAG:Link2"
I'm expecting only the first array without the curly braces...what am i missing with the regex? thx.
$pattern = "/{(.*?Link.*?)}/";andprint_r($matches[1]);