/[pcre]/code/trunk/doc/pcredemo.3
ViewVC logotype

Diff of /code/trunk/doc/pcredemo.3

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 429 by ph10, Tue Sep 1 16:10:16 2009 UTC revision 453 by ph10, Fri Sep 18 19:12:35 2009 UTC
# Line 240  if (namecount <= 0) printf("No named sub Line 240  if (namecount <= 0) printf("No named sub
240  *                                                                        *  *                                                                        *
241  * If the previous match WAS for an empty string, we can't do that, as it *  * If the previous match WAS for an empty string, we can't do that, as it *
242  * would lead to an infinite loop. Instead, a special call of pcre_exec() *  * would lead to an infinite loop. Instead, a special call of pcre_exec() *
243  * is made with the PCRE_NOTEMPTY and PCRE_ANCHORED flags set. The first  *  * is made with the PCRE_NOTEMPTY_ATSTART and PCRE_ANCHORED flags set.    *
244  * of these tells PCRE that an empty string is not a valid match; other   *  * The first of these tells PCRE that an empty string at the start of the *
245  * possibilities must be tried. The second flag restricts PCRE to one     *  * subject is not a valid match; other possibilities must be tried. The   *
246  * match attempt at the initial string position. If this match succeeds,  *  * second flag restricts PCRE to one match attempt at the initial string  *
247  * an alternative to the empty string match has been found, and we can    *  * position. If this match succeeds, an alternative to the empty string   *
248  * proceed round the loop.                                                *  * match has been found, and we can proceed round the loop.               *
249  *************************************************************************/  *************************************************************************/
250    
251  if (!find_all)  if (!find_all)
# Line 268  for (;;) Line 268  for (;;)
268    if (ovector[0] == ovector[1])    if (ovector[0] == ovector[1])
269      {      {
270      if (ovector[0] == subject_length) break;      if (ovector[0] == subject_length) break;
271      options = PCRE_NOTEMPTY | PCRE_ANCHORED;      options = PCRE_NOTEMPTY_ATSTART | PCRE_ANCHORED;
272      }      }
273    
274    /* Run the next matching operation */    /* Run the next matching operation */

Legend:
Removed from v.429  
changed lines
  Added in v.453

webmaster@exim.org
ViewVC Help
Powered by ViewVC 1.1.12