this is my sample text:
text text text
[[{"fid":"3228","view_mode":"full","fields":{"format":"full","field_file_image_alt_text[und][0][value]":"text text text","field_file_image_title_text[und][0][value]":"","field_file_image_gallery_content[und][0][value]":"","field_file_image_gallery_content[und][0][format]":"full_html"},"type":"media","link_text":null,"attributes":{"alt":"text text","height":"647","width":"421","class":"media-element file-full"}}]]
I want to extract the text between the double brackets: [[
and ]]
.
This is my approach:
preg_match_all("/[[^]]*]/", $txt, $matches);
But it works only for text between singles brackets like [
and ]
.
How does my regex to have to look like, to extract the text between double brackets?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…