Usando regex com linguagem C
Publicado por Andre Luiz da Silva 29/05/2004
[ Hits: 17.809 ]
Homepage: http://localhost
Segue ae um pequeno exemplo que eu retirei de um site sobre como se trabalhar com regex em linguagem C, espero que seja util....
Falowz....
#include <stdio.h>
#include <regex.h>
main (argc,argv)
int argc;
char **argv;
{
char buffer[1024];
regex_t rx;
regmatch_t match;
size_t nmatch = 1;
if (regcomp(&rx, argv[1], REG_EXTENDED) != 0)
{
perror("regcomp");
return;
}
while (!feof(stdin))
{
fgets(buffer,1024,stdin);
if (regexec(&rx,buffer,1,&match,0) == 0)
{
printf("Matched:(%s) at %d to %d",buffer,match.rm_so,match.rm_eo);
}
}
regfree(&rx);
}
Cirurgia para acelerar o openSUSE em HD externo via USB
Void Server como Domain Control
Modo Simples de Baixar e Usar o bash-completion
Monitorando o Preço do Bitcoin ou sua Cripto Favorita em Tempo Real com um Widget Flutuante
Como quebrar senha usando john the ripper
[Resolvido] VirtualBox can't enable the AMD-V extension
Como verificar a saúde dos discos no Linux
Como instalar , particionar, formatar e montar um HD adicional no Linux?
Não consigo instalar distro antiga no virtualbox nem direto no hd (21)
Podem me chamar de 1mbecil :) [RESOLVIDO] (29)









