Boost::Regex question

Hi, I'm currently evaluating the Regex package and encountered a minor issue. I need to match a string that can contain some special characters (.[{()\*+?|^$) as well. My question is if there is a way to tell Regex to treat this string "as is", including the special characters? I need to do this without escaping the special characters in the string or the match expression. For those of you familiar with Tcl Expect, I'm looking for an option similar to "expect -ex". Thank you! Regards, Dima Kagan

Dima Kagan wrote:
Hi,
I'm currently evaluating the Regex package and encountered a minor issue. I need to match a string that can contain some special characters (.[{()\*+?|^$) as well. My question is if there is a way to tell Regex to treat this string "as is", including the special characters? I need to do this without escaping the special characters in the string or the match expression. For those of you familiar with Tcl Expect, I'm looking for an option similar to "expect -ex".
boost::regex e(mystring, boost::regex::literal); HTH, John.

Thank you! That should do it :) Regards, Dima Kagan John Maddock wrote:
Dima Kagan wrote:
Hi,
I'm currently evaluating the Regex package and encountered a minor issue. I need to match a string that can contain some special characters (.[{()\*+?|^$) as well. My question is if there is a way to tell Regex to treat this string "as is", including the special characters? I need to do this without escaping the special characters in the string or the match expression. For those of you familiar with Tcl Expect, I'm looking for an option similar to "expect -ex".
boost::regex e(mystring, boost::regex::literal);
HTH, John. _______________________________________________ Boost-users mailing list Boost-users@lists.boost.org http://lists.boost.org/mailman/listinfo.cgi/boost-users
participants (2)
-
Dima Kagan
-
John Maddock