FREE Subscription to Dr. Dobb’s Digest: Same Great Content, New Digital Edition
Site Archive (Complete)
Architecture & Design
Email
Print
Reprint

add to:
Del.icio.us
Digg
Google
Furl
Slashdot
Y! MyWeb
Blink
April 01, 1999

Regular Expressions

(Page 7 of 7)
Apr99: Regular Expressions


/* matchstar: leftmost longest search for c*re */
int matchstar(int c, char *re, char *text)
{
  char *t;

  for (t = text; *t != '\0' && (*t == c || c == '.'); t++)
     ;
  do {   /* * matches zero or more */
     if (matchhere(re, t))
        return 1;
  } while (t-- > text);
  return 0;
}

Example 6: A version of matchstar that does leftmost longest matching.


Copyright © 1999, Dr. Dobb's Journal
Previous Page | 1 | 2 | 3 | 4 | 5 | 6 | 7
TOP 5 ARTICLES
No Top Articles.



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK