#include <cstdio>
#include <regex.h>
#include <string>
#include <sys/types.h>

static const char *regex = "\\.([ \t]+|$)";

int
main (void)
{
  regex_t re;
  regmatch_t matches[1];
  char errbuf[256];
  size_t offset;
  int err;
  int eflags;

  std::string str = "SourceForge.net provides hosting for Open Source "
                    "software development projects. You may register a "
                    "project for hosting on SourceForge.net using the "
                    "\"Create Project\" link under the \"Projects\" "
                    "navigation item. When you register a new project, it "
                    "will appear on this page as a Pending Project, until "
                    "such time as it is approved (and it becomes an Active "
                    "Project) or is rejected (and it becomes a Deleted/"
                    "Rejected Project) by SourceForge.net staff.";

  err = regcomp (&re, regex, REG_EXTENDED);
  if (err != 0)
    {
      regerror (err, &re, errbuf, sizeof (errbuf));
      fprintf (stderr, "regcomp: %s\n", errbuf);
      return 1;
    }

  offset = 0;

  while (offset < str.length ())
    {
      if (offset == 0)
        eflags = 0;
      else
        eflags = REG_NOTBOL;

      err = regexec (&re, str.substr (offset).c_str (),
                     sizeof (matches) / sizeof (matches[0]), matches, eflags);
      if (err != 0)
        {
          regerror (err, &re, errbuf, sizeof (errbuf));
          fprintf (stderr, "regexec: %s\n", errbuf);
          return 1;
        }

      if (matches[0].rm_so < 0)
        continue;

      printf ("Match: %zu-%zu: %s\n",
              matches[0].rm_so + offset,
              matches[0].rm_eo + offset,
              str.substr (matches[0].rm_so + offset,
                          matches[0].rm_eo - matches[0].rm_so).c_str ());

      offset += matches[0].rm_eo;
    }

  return 0;
}


Output:
$ ./test
Match: 78-80: . 
Match: 206-208: . 
Match: 443-444: .