views:

84

answers:

0

Please could you explain why given the following boost::regex pattern:

boost::regex re("/\\S+\\w");

/index.html is a match and /~index.html is not? RegexBuddy in Perl mode finds a match in both cases.

Could you suggest a pattern that would work? Thanks!!

P.S. The \\w at the end is needed in order to ignore the punctuation on the end of an URL like /index.html..

UPD: Sorry just tried to make a simple test program and it works there. I guess the problem might be in the code that calls regex_search. I need a bit more time to find this out.

UPD2: Indeed the problem was in my code. Please vote to close the question. Sorry for not researching enough before posting.