About Us
About the blog
Techgaun means Tech + Gaun and the meaning of Gaun in nepali language is Village. So techgaun is like a village for tech-loving people where you might not find everything but you'll surely find something interesting and useful.
About the authors of this blog
Samar Dhwoj Acharya
I am Samar Dhwoj Acharya, a computer engineering undergraduate and a tech enthusiast. I am highly interested in the technology stuffs esp. in softwares and security aspects. As of now, I am working for a new startup and doing lots of freelancing in the meantime.
Brisha Pote
A computer engineering student interested in photography and other creative stuffs.
We are happy to have three new guys in our team as author. We hope they will actively post on the blog.
Saurya Dhwoj Acharya
Abhiyan Thapa
DaNePaLI
Read more...
Techgaun means Tech + Gaun and the meaning of Gaun in nepali language is Village. So techgaun is like a village for tech-loving people where you might not find everything but you'll surely find something interesting and useful.
About the authors of this blog
Samar Dhwoj Acharya
I am Samar Dhwoj Acharya, a computer engineering undergraduate and a tech enthusiast. I am highly interested in the technology stuffs esp. in softwares and security aspects. As of now, I am working for a new startup and doing lots of freelancing in the meantime.
Brisha Pote
A computer engineering student interested in photography and other creative stuffs.
We are happy to have three new guys in our team as author. We hope they will actively post on the blog.
Saurya Dhwoj Acharya
Abhiyan Thapa
DaNePaLI
Read more...
Comments (17)

Sort by: Date Rating Last Activity
Loading comments...
Post a new comment
Comments by IntenseDebate
About Us
2013-12-15T00:21:00+05:45
Cool Samar
Subscribe to:
Posts (Atom)
anonymous · 754 weeks ago
Samar Dhwoj Acharya · 754 weeks ago
Abhiyan Thapa · 753 weeks ago
sanoj · 725 weeks ago
Saurya · 712 weeks ago
sumz · 700 weeks ago
Trapped · 695 weeks ago
Sanket · 681 weeks ago
samar · 675 weeks ago
techgaun 46p · 675 weeks ago
Anonymous · 661 weeks ago
uNuN · 654 weeks ago
samar · 649 weeks ago
#include <regex.h>
#include <stdlib.h>
int main(int argc, char **argv)
{
regex_t re;
FILE *fp;
int r;
short int found = 0;
char *line = NULL;
char inp[1024];
size_t len = 0;
ssize_t read;
if (argc < 2)
{
printf("Usage: %s <filename>nn", argv[0]);
exit(EXIT_FAILURE);
}
if ((fp = fopen(argv[1], "rb")) == NULL)
{
perror("Unable to open the specified file.");
exit(EXIT_FAILURE);
}
printf("Enter the string to test: ");
//scanf("%s", inp);
fgets(inp, sizeof(inp), stdin);
while ((read = getline(&line, &len, fp)) != -1)
{
if ((r = regcomp(&re, line, REG_EXTENDED | REG_NEWLINE)) != 0)
{
printf("Invalid regular expression %sn", line);
regfree(&re);
continue;
}
r = regexec(&re, inp, 0, NULL, 0);
if (r == 0)
{
printf("Given string %s matched regex %snn", inp, line);
found = 1;
}
/*else if (r == REG_NOMATCH)
{
printf("Given string %s did not match regex %snn", inp, line);
}*/
regfree(&re);
}
if (found == 0)
{
printf("No RE is matched with given stringnn");
}
fclose(fp);
return 0;
}
regex file:
1
[[:digit:]]
[a-z]*
[0-9]{1,5}
[[:alpha:]]
Samar · 649 weeks ago
algocity · 643 weeks ago
I also love Technoloy.....
Dipesh wagle · 580 weeks ago
techgaun 46p · 580 weeks ago