Regular Expression

This is a discussion on Regular Expression within the C++ Programming forums, part of the General Programming Boards category; Hi, Does anybody know how to use regular expressions within C++. I am looking for a function to compare a ...

  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
    Portugal
    Posts
    7,535
    There's GRETA, Boost.Regex, regex++... you will have to implement it through one of these external libraries.
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    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,075
    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, 03: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, 11: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, 05:21 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21