How to get the shortest rather than longest possible regex match with preg_match()

Use non greedy modifier ? :

preg_match("/\{\{(.*?)\}\}/si",$content,$matches);
             here --^

Leave a Comment