-
-
Notifications
You must be signed in to change notification settings - Fork 68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
please insert also perl and PCRE #190
Comments
Hi @faustfa, if I understand your request correctly, you want to add
Regarding Perl: Regarding C: #include "pcre.h"
#include <string.h>
int usePcre(char* textToCheck) {
/* for pcre_compile */
pcre* regex;
const char* error;
int erroffset;
/* for pcre_exec */
int rc;
int ovector[30];
/* to get substrings from regex */
int rc2;
const char *substring;
/* return value */
int returnValue = -1;
regex = pcre_compile("regex", 0, &error, &erroffset, NULL);
rc = pcre_exec(regex, NULL, textToCheck, (int)strlen(textToCheck), 0, 0, ovector, 30);
if(rc == PCRE_ERROR_NOMATCH) {
fprintf(stderr,"no match\n");
returnValue = 0;
} else if(rc < -1) {
fprintf(stderr,"error %d from regex\n",rc);
returnValue = -2;
} else {
returnValue = 1;
}
pcre_free(regex);
return returnValue;
} Is this code correct? Should something be different? And please provide details on how I can pass the options (multiline, case-insensitive, dot-all) to the regex. Otherwise I'm afraid I cannot add this snippet as I don't know how to generate it. Thank you! |
Hi @faustfa : Please comment on this PR. I have no knowledge how to use Perl and the C-PCRE code above is just a best guess from my side. If there is no reaction on this PR, I will close it soon. |
Hi can you insert also Syntax language for PERL and PCRE and PCRE2 and classical C the world would reward you , and i too thanks so much for your big work
The text was updated successfully, but these errors were encountered: