REGEX

Hi every one i have problem with regex


file input.txt have structure like this:
1
2
[A-Z]o
Hello everyone! I am John

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <iostream>
#include <string>
#include <regex>
using namespace std;
[code]void main()
{

	
	string temp; // Save "Hello everyone! I am John"
	temp.resize(500);
	char REGEX[500];  // Save [A-Z]o 
	FILE *fi,*fo;
	
	//
	fi = fopen("input.txt","rt");
	fscanf(fi,"%[^\n]\n",&REGEX);

	regex rg(REGEX); // Save REGEX into regex 


	char s;
	int i = 0;
	int ntemp = 0; // elements number of temp
	while (!feof(fi))
	{
		if (fscanf(fi,"%c",&s) > 0)
		temp[i] = s;
		i++;
		ntemp++;
	}

	temp[ntemp] = '\0';


/////// What should i do here ??????????
	
	fo = fopen("output.txt","wt");

	fcloseall();
}
[/code]

I need to find in tmp the fist position that matches regex.... What should i do???

Thks
Topic archived. No new replies allowed.