.* is greedy match
.*? is non-greedy match
PHP example:
$str="abc123abc456abc";
preg_match("/abc(.*)abc/",$str,$match);
echo $match[1]; // result is 123abc456
preg_match("/abc(.*?)abc/",$str,$match);
echo $match[1]; // result is 123
.* is greedy match
.*? is non-greedy match
PHP example:
$str="abc123abc456abc";
preg_match("/abc(.*)abc/",$str,$match);
echo $match[1]; // result is 123abc456
preg_match("/abc(.*?)abc/",$str,$match);
echo $match[1]; // result is 123
This page contains a single entry by Pank published on May 12, 2016 10:19 AM.
sshpass was the previous entry in this blog.
OTA Images for Nexus Devices is the next entry in this blog.
Find recent content on the main index or look in the archives to find all content.