regular expression in c++

R

Ron Eggler

Hi,

Is there some standard or semi standard library to do regular expressions in
c++? I need to recognize if some string is an ip address or not and decide
upon that.

Thanks,
Ron
 
F

Fernando Gómez

Hi,

Is there some standard or semi standard library to do regular expressions in
c++? I need to recognize if some string is an ip address or not and decide
upon that.

Thanks,
Ron

It is considered in the new version of the standard, so-called TR1.
Some compilers, like Visual C++ 8, already have it implemented.

See:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1429.htm
http://msdn.microsoft.com/en-us/library/bb982727.aspx
http://www.codeproject.com/KB/string/TR1Regex.aspx

Although it is still a draft so far. So, you can consider other
options, like the aforementioned Boost.
 
R

Ron Eggler

Fernando said:
It is considered in the new version of the standard, so-called TR1.
Some compilers, like Visual C++ 8, already have it implemented.

See:
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1429.htm
http://msdn.microsoft.com/en-us/library/bb982727.aspx
http://www.codeproject.com/KB/string/TR1Regex.aspx

Although it is still a draft so far. So, you can consider other
options, like the aforementioned Boost.

Does anyone know if there's something integrated into the GNU tools already?
I'm compiling using g++.
 
D

Darío Griffo

Does anyone know if there's something integrated into the GNU tools already?
I'm compiling using g++.

Like they said above there is tr1, and it's supported in gcc since
version 4.0
so, if your gcc can compile this
#include<iostream>
#include<tr1/tuple>
int main()
{
std::tr1::tuple<int, std::string, double, int, int> t(12,"Hello",
43.56,1,2);
std::cout<<std::tr1::get<4>(t)<<std::endl;
}

you sure hace tr1::regex
After that all you need is google :D
 
B

Bo Schwarzstein

Yep, and it's the same API that will be in the next standard and is in
TR1, or close to it.

Yes, I also like the boost::regex, it's easy to use, fast.
 
F

Fernando Gómez

It is considered in the new version of the standard, so-called TR1.
Some compilers, like Visual C++ 8, already have it implemented.

Sorry, a finger mistake. I meant Visual C++ 9.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,172
Messages
2,570,934
Members
47,478
Latest member
ReginaldVi

Latest Threads

Top