Thread: Regular Expression

  1. #1
    Registered User
    Join Date
    Jun 2006
    Posts
    1

    Regular Expression

    Hi,

    Does anybody know how to use regular expressions within C++. I am looking for a function to compare a string against a regular expression.

    I am happy for any provided help.

    The ideal function should take an input string and a regular expression. If the string matches the regular expression the function should return true.


    Kind Regards,

    tintifaxe

  2. #2
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    There's GRETA, Boost.Regex, regex++... you will have to implement it through one of these external libraries.
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  3. #3
    Registered User
    Join Date
    Jun 2006
    Posts
    29
    I'm not quite sure whats your question is but to compare STRING and a CHAR I transform the STRING into a CHAR
    Code:
    string a;
    string c;
    char b[256];
    c=b;
    if(a==c){
    
    }

  4. #4
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Quote Originally Posted by gftmc
    I'm not quite sure whats your question is
    Perhaps you should look into Regular Expressions.
    Sent from my iPadŽ

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. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  4. regular expression query in PERL
    By Akhil in forum Tech Board
    Replies: 3
    Last Post: 03-29-2004, 10:26 AM
  5. Regular Expression Troubles
    By Unregistered in forum C++ Programming
    Replies: 2
    Last Post: 04-11-2002, 04:21 PM