Thread: regular expression

  1. #1
    Registered User
    Join Date
    Jul 2010
    Posts
    32

    regular expression

    Hello guys,
    is there a standard library in VS for using regular expressions?i know unix has regexec, i am trying to find something which is as close to this as possible
    thanks

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    If you are using Visual Studio 2008 or 2010, you should be able to use the regular expression functionality in the TR1 extensions to the standard library, i.e., #include <regex> and use std::tr1::regex.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Registered User
    Join Date
    Jul 2010
    Posts
    32
    hello there, thanks for your reply, i have done what you said and it works, i jsut have one question.

    in unix you do a regcomp before doing a regexec, but it seems as though the equivalent on windows is just simply calling regex_search, am i correct or have i misunderstood something?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Screwy Linker Error - VC2005
    By Tonto in forum C++ Programming
    Replies: 5
    Last Post: 06-19-2007, 02:39 PM
  2. recursion error
    By cchallenged in forum C Programming
    Replies: 2
    Last Post: 12-18-2006, 09:15 AM
  3. Regular Expression
    By tintifaxe in forum C++ Programming
    Replies: 3
    Last Post: 06-14-2006, 07:16 AM
  4. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  5. Regular Expression Troubles
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 04-11-2002, 04:21 PM