home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / sys / hp / 12706 < prev    next >
Encoding:
Internet Message Format  |  1992-11-09  |  1.1 KB

  1. Path: sparky!uunet!ogicse!emory!swrinde!sdd.hp.com!hp-col!fc.hp.com!ec
  2. From: ec@fc.hp.com (Edgar_Circenis)
  3. Newsgroups: comp.sys.hp
  4. Subject: Re: Problems with regcomp() and regexec()
  5. Message-ID: <BxGM76.6Dp@fc.hp.com>
  6. Date: 9 Nov 92 17:35:30 GMT
  7. Article-I.D.: fc.BxGM76.6Dp
  8. References: <1992Nov9.165816.7162@mercury.unt.edu>
  9. Sender: news@fc.hp.com (news daemon)
  10. Organization: Hewlett-Packard Fort Collins Site
  11. Lines: 16
  12. X-Newsreader: TIN [version 1.1.4 PL6]
  13.  
  14. cpearce@nemesis.acs.unt.edu wrote:
  15. > I'm currently trying to use the regular expression routines newly provided
  16. > in HPUX 8.0. As far as I can tell, I'm using the routines properly, but
  17. >     * I'm never able to get a full-line match and
  18. >     * Subexpressions don't seem to be behaving properly.
  19. >         if (regexec (&r1, str, r1.re_nsub, rm, NULL))
  20. >             printf ("Mathced.\n");
  21. >         if (regexec (&r2, str, r2.re_nsub, rm, NULL))
  22. >             printf (Matched. sp = %x; ep = %x\n", rm [1].sp, rm [2].ep);
  23.  
  24. Well, for one thing, regexec() returns zero upon success.  Your code expects
  25. non-zero.
  26.  
  27. Edgar Circenis
  28.