Thank you!
I was thinking that too, but I was not sure. It seems that the Posix have more coinstraints than PCRE. And right now its confusing a lot.
Why do you have to have double backslashes (\1) when you use back reference? (This is with the funtion preg_match_all() which uses PCRE)
In the manual all I can see is examples with a single backslash. Anyway when I changed my back reference from one to double backslashes it seems to work. Otherwise I don't know what I'm doing.
Heres the the pattern if anyone interessed,
"/^[^\[\]]*(\[(länk)\][^\[\]]*\[\/\\2\][^\[\]]*)*$/i"
which will validate the string
blaom[länk]ab aaaa a[/länk] g//g/hf g[länk]ab ag aa[/länk] sd fh dsf sdfj dsfjh jh dsfj hdfs