My real problem is like this:
I have this string: abc <def> /*ghi<xyz>jkl*/ mno <pqr> stu
and I want to get <def> and <pqr> only.
But after going around, I have a starting solution, strangely it doesn't work for my case:
Code: Select all
preg_match_all('/{[^{}]*}/', 'abc {def} mno {pqr} stu', $matches);Code: Select all
preg_match_all('/<[^<>]*>/', 'abc <def> mno <pqr> stu', $matches);So... anyone here want to tell me why it is or maybe directly to the solution of my problem?
Thanks in advance!