Boost logo

Boost Users :

Subject: Re: [Boost-users] [Regex] Search Substring with paranthesis
From: Kulti (kultihell_at_[hidden])
Date: 2011-03-15 09:21:20


On Tue, Mar 15, 2011 at 1:06 PM, Roman Perepelitsa
<roman.perepelitsa_at_[hidden]> wrote:
> 2011/3/15 Subhash Nagre <snagre.mumbai_at_[hidden]>
>>
>> Hello,
>> I have a string "(123) Hello" and I want to seach String (123) using
>> boost::regex,
>> Also I needed to do a full word search, so I added  \b in the end.
>> Here is my code
>>
>> std::string searchWord = "(123)";
>
> Try "\\(123\\)".
> Roman Perepelitsa.
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>

  std::string searchWord = "(\\N{left-parenthesis}123\\N{right-parenthesis})";
// searchWord += "\\b"; // Step 1


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net