that page's description of regex_match has got to be wrong. what good use is there to match the entire line to the regex? seriously, think about it. I would substitute the abiguous term "target" for some other more specific variable name listed below.
On Wed, November 2, 2016 8:30 pm, NightStrike wrote: > On Wed, Nov 2, 2016 at 9:07 PM, Jim Michaels <[email protected]> > wrote: > >> #include <regex> >> #include <iostream> >> int main(void) { >> std::cout<<(std::regex_match("abcdefg",std::regex("def",std::regex_cons >> tants::extended))?"true":"false")<<std::endl; >> return 0;} >> >> corrected some more bugs in that example and got "false". not sure why >> this is. sorry for the bumpy ride. > > This is, like your previous issue, due to your lack of understanding > the rules of C++ (specifically, the C++ Standard Library). You should make > use of cppreference.com, as it's a very good information source here. If > you did, you'd see this: > > http://en.cppreference.com/w/cpp/regex/regex_match > "...Determines if there is a match between the regular expression e > and the entire target character sequence [first,last)...." > > What you really want is this: > > > http://en.cppreference.com/w/cpp/regex/regex_search > "....Determines if there is a match between the regular expression e > and some subsequence in the target character sequence...." > > Notice the difference? The function you are using matches on the > entire string, and thus only returns true if the regex is true for the > entire string. The second function operates on a substring, which is what > you want here. It's more like "grep" in this regard, if that analogy > works for you. > > Please try to read the documentation of the language. > > >> the function below is an old namespace clash bug between user-defined >> str and compiler's std for string and maybe algorithm. > > No, it was your incorrect use of namespace syntax. The compiler is fine. > > >> I could suppose it might be 10 years for a fix for that to reach gcc... >> :-( I know you folks are really busy. I just want a working and >> hopefully up-to-date compiler from somewhere for windows that isn't >> waving the dragon flag (you've *got* to be serious folks, those things >> are nasty). > > I think you should update your knowledge of the language. I also > think you should ask these basic, fundamental language questions in a forum > that is geared toward this sort of thing. You have been emailing this > list for years now, and aside from one or two exceptions (you did point > out a valid bug or two), every email has been off topic. We are generally > pretty lenient, and try to be a helpful audience. But then, you aren't > very nice about it, either. Honestly, you're kind of a mean, highly > insulting person that demands basic "google search" help on the wrong > topic from the wrong people. I don't understand why you do this > repeatedly, year after year. > > I hope you realize what mingw-w64 is and is not: It is a project that > provides headers and imports to the Windows APIs. As a nicety, we also > host some compiler toolchains that kind people build as a convenience > ONLY. We are *NOT* GCC. You can find that project at > gcc.gnu.org, whereas we are at mingw-w64.sf.net. We are also not a general > programming help forum. We tend to be nice people that help each other > out, and I myself have asked lots of questions over the years that are > unrelated to mingw-w64, both on the list and mainly in IRC. But just like > you wouldn't try to buy postage stamps at a restaurant, you are really > barking up the wrong tree here. I think, honestly, what you really need > is a good programming resource or tutor. Perhaps lynda.com can be of help > here, or irc://irc.freenode.net/##C++-general > > > ------------------------------------------------------------------------- > ----- > Developer Access Program for Intel Xeon Phi Processors > Access to Intel Xeon Phi processor-based developer platforms. > With one year of Intel Parallel Studio XE. > Training and support from Colfax. > Order your platform today. http://sdm.link/xeonphi > _______________________________________________ > Mingw-w64-public mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/mingw-w64-public > > -- Jim Michaels [email protected] ------------------------------------------------------------------------------ Developer Access Program for Intel Xeon Phi Processors Access to Intel Xeon Phi processor-based developer platforms. With one year of Intel Parallel Studio XE. Training and support from Colfax. Order your platform today. http://sdm.link/xeonphi _______________________________________________ Mingw-w64-public mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/mingw-w64-public
