Re: C++0x regex supported by gcc?

Discussion in 'C++' started by Robert Fendt, Jan 31, 2010.

  1. Robert Fendt

    Robert Fendt Guest


    > Hi all, do you know if gcc supports the regex library defined in the C+
    > +0x draft? If so, which version? Can you provide a simple snippet?


    As far as I know, GCC does not support regular expressions as defined in TR1 as part of its standard library (yet). However, to use 0x features already before standardisation would be a portability nightmare (not to speak of stability issues to be expected in the early implementations).

    If you want to stay at least semi-portable and need a solid regex library for C++, just use boost::regex for now. The TR1 specification is based upon it anyway. Or, if you are concerned about code changes after the compilers have caught up with the standard, you can use boost::tr1.

    http://www.boost.org/doc/libs/1_41_0/libs/regex/doc/html/index.html
    http://www.boost.org/doc/libs/1_41_0/doc/html/boost_tr1.html

    Regards,
    Robert
     
    Robert Fendt, Jan 31, 2010
    #1
    1. Advertising

  2. Robert Fendt

    Devil Wang Guest

    you should link the BOOST library while compiling .



    On Feb 1, 1:43 am, Robert Fendt <> wrote:
    > > Hi all, do you know if gcc supports the regex library defined in the C+
    > > +0x draft? If so, which version? Can you provide a simple snippet?

    >
    > As far as I know, GCC does not support regular expressions as defined in TR1 as part of its standard library (yet). However, to use 0x features already before standardisation would be a portability nightmare (not to speak of stability issues to be expected in the early implementations).
    >
    > If you want to stay at least semi-portable and need a solid regex library for C++, just use boost::regex for now. The TR1 specification is based upon it anyway. Or, if you are concerned about code changes after the compilers have caught up with the standard, you can use boost::tr1.
    >
    > http://www.boost.org/doc/libs/1_41_...t.org/doc/libs/1_41_0/doc/html/boost_tr1.html
    >
    > Regards,
    > Robert
     
    Devil Wang, Feb 4, 2010
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    8
    Views:
    433
  2. Kevin P. Fleming

    C99 structure initialization in gcc-2.95.3 vs gcc-3.3.1

    Kevin P. Fleming, Nov 6, 2003, in forum: C Programming
    Replies:
    2
    Views:
    648
    Kevin P. Fleming
    Nov 6, 2003
  3. Replies:
    5
    Views:
    363
    Nathan Addy
    Sep 17, 2005
  4. Replies:
    3
    Views:
    773
    Reedick, Andrew
    Jul 1, 2008
  5. Jorgen Grahn

    Re: C++0x regex supported by gcc?

    Jorgen Grahn, Feb 3, 2010, in forum: C++
    Replies:
    0
    Views:
    792
    Jorgen Grahn
    Feb 3, 2010
Loading...

Share This Page