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 4 of 7)
Apr99: Regular Expressions


/* matchstar: search for c*re at beginning of text */
int matchstar(int c, char *re, char *text)
{
   do {  /* a * matches zero or more instances */
      if (matchhere(re, text))
         return 1;
   } while (*text!='\0' && (*text++==c || c=='.'));
   return 0;
}

Example 3: The function matchstar is called when the expression begins with a starred character.


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



MICROSITES
FEATURED TOPIC

ADDITIONAL TOPICS

INFO-LINK