On 7 January 2013 at 23:20, Johannes Ranke wrote:
| Package: r-base-core
| Severity: normal
| 
| I have started on a test case (attached), but, as mentioned, I did not succeed
| to figure out exactly how the tre functions are being called under these
| circumstances. Any help would be appreciated.

I should really try to find some time to give you a hand here....

Appreciate all the work you've done already.

Dirk
 
| ----------------------------------------------------------------------
| #include <stdio.h>
| #include <tre/tre.h>
| 
| int main(int argc, char *argv[])
| {
| 
|   if(argc!=3)
|   {
|     printf("Usage: %s [regexp] [string]\n\n", argv[0]);
|   } else {
|     printf("Regular expression: %s\n", argv[1]);
|     printf("String to search in: %s\n", argv[2]);
|   }
| 
|   regex_t regex;
|   int reti;
|   reti = tre_regcomp(&regex, argv[1], REG_EXTENDED); // Maybe tre_regwcomp() 
needs to be used here...
|   if (reti) { 
|     fprintf(stderr, "Could not compile regex: %s\n", argv[1]); return(1);
|   }
| 
|   /* Now tre_regexec() would need to be called in the way it is called by 
do_gsub() from src/main/grep.c in the R sources
|   and the result would need to be returned.
|   */
|   // reti = tre_regexec(&regex, argv[2], 0, NULL, 0);
|  
|   tre_regfree(&regex);
| 
|   return(0);
| }

-- 
Dirk Eddelbuettel | e...@debian.org | http://dirk.eddelbuettel.com  


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to