My pattern matching was failing when I had these definitions, which I happen to prefer: const string number = "[0-9]+"; const string name = "[A-z][A-z0-9]*"; ("name" is supposed to match a typical variable name) The program is working fine now, after I am using these ones: const string number = "\\d+"; const string name = "[A-z]\\w*"; The only difference that I aware of, is that the second form accepts underscores as part of variable names. TIA, -RFH
On Mon, Mar 28, 2011 at 4:07 AM, Ramon F Herrera
My pattern matching was failing when I had these definitions, which I happen to prefer:
const string number = "[0-9]+"; const string name = "[A-z][A-z0-9]*";
("name" is supposed to match a typical variable name)
The program is working fine now, after I am using these ones:
const string number = "\\d+"; const string name = "[A-z]\\w*";
The only difference that I aware of, is that the second form accepts underscores as part of variable names.
TIA,
-RFH
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Could you please read documentation before posting question? http://www.boost.org/doc/libs/1_45_0/libs/regex/doc/html/boost_regex/syntax/... "w - Any word character (alphanumeric characters plus the underscore)"
On 3/28/2011 2:04 AM, Kulti wrote:
Could you please read documentation before posting question?
I don't knot about you, but I definitely prefer a human response. If we all read and studied the documentation, you would not have the chance to show your expertise. Check how Microsoft, Sun and others award points (even military-type stars) to folks who provide answers different from a simple "RTFM". Thanks for the URL, no thanks for the rest. :-) -Ramon F. Herrera (Internet and Usenet FOUNDER/PIONEER)
On Mon, Mar 28, 2011 at 11:46 AM, Ramon F Herrera
On 3/28/2011 2:04 AM, Kulti wrote:
Could you please read documentation before posting question?
I don't knot about you, but I definitely prefer a human response.
If we all read and studied the documentation, you would not have the chance to show your expertise. Check how Microsoft, Sun and others award points (even military-type stars) to folks who provide answers different from a simple "RTFM".
Thanks for the URL, no thanks for the rest. :-)
-Ramon F. Herrera (Internet and Usenet FOUNDER/PIONEER)
_______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
Ramon, I think, that people should try to find answers independently. Your question about regular expression in general, not in specific of boost.regex library - at first. At second, you ask about base element of regex - clearly, that you no hard to read something more about regex before using it. I spent 15 seconds to find this link. It's not so hard. Seriously...
My pattern matching was failing when I had these definitions, which I happen to prefer:
const string number = "[0-9]+"; const string name = "[A-z][A-z0-9]*";
("name" is supposed to match a typical variable name)
The program is working fine now, after I am using these ones:
const string number = "\\d+"; const string name = "[A-z]\\w*";
The only difference that I aware of, is that the second form accepts underscores as part of variable names.
Correct there should be no difference - do you have a test case? Thanks, John.
participants (3)
-
John Maddock
-
Kulti
-
Ramon F Herrera