Q:

How to prevent pcre(C library) to continue matching when it failed in one string?

If I have a string and a pattern: 
char src[]="\"http://www.aaa.cn\"</tab><tab>\"www.bbb.com\""; 
char pattern[] = "\"http:\/\/.*\.com\"";  

Then it returns "http://www.aaa.cn\"</tab><tab>\"www.bbb.com" to me (it failed but continue matching next characters).
I just want  some like "http://www.aaa.com", "http://www.bbb.com", not like that combined string.
Can someone help me out? Should I change my pattern or add some arguments to pcre_compile() and pcre_exec() functions?

A:

Try this.
char pattern[] = "\"http://[^\"]*\"";

Better yet, don't parse HTML (or fragments thereof or XML) with regexen.

