Recent content by cheers00
-
C
C/C++ Why is my C++ regex not matching?
doubling back slash worked. thank you- cheers00
- Post #6
- Forum: Programming and Computer Science
-
C
C/C++ Why is my C++ regex not matching?
I am wondering why this is not matching. I tested my regular expression on notepad2 and it matches fine. [FONT="Courier New"]std::string line = " 10 0 5 0"; std::regex rgx("\s+\d+\s+\d+\s+\d+\s+\d+"); if (regex_match(line, rgx)) { // do something... int a = 2; }- cheers00
- Thread
- C++
- Replies: 6
- Forum: Programming and Computer Science
-
C
C/C++ Is using string as expression possible in c++?
Also, can you please give me an example to how to use variable parameter? cheers- cheers00
- Post #26
- Forum: Programming and Computer Science
-
C
C/C++ Is using string as expression possible in c++?
Serena, thanks. But I also had to change isinteger function to isNumber. The following seems to work but let me know if I can make it better. [FONT="Courier New"][SIZE="3"][SIZE="2"]inline bool isNumber(char *&src, double &number) { if (!isdigit(*src)) return false; int integer = 0...- cheers00
- Post #25
- Forum: Programming and Computer Science
-
C
C/C++ Is using string as expression possible in c++?
Hi "I like Serena"', your code doesn't work with decimal numbers. Wondering if it is a easy thing to do.- cheers00
- Post #22
- Forum: Programming and Computer Science