I have imported Boost library in to a .dll that I am using. I am trying to parse a string using:
boost::wregex regPlayerAtSeat(L"*Governor: Seat.?[1-9].*");
But all I get is an ‘interop service exception. Is the syntax of my regex wrong?
Thanks, R.
The first
*doesn’t appear to have any characters before it. In regex it acts as a quantifier, not a wildcard like in UNIX command lines and so forth. You probably want something like.*in its place, but that’s partly just a guess. The full regex would then look like this:.*will match zero or more repetitions of (almost) any character (probably not newlines, but I don’t know the inner workings of the boost regex engine). Is that what you were going for at the beginning of your string? Alternatively, since you haven’t anchored your regex, you might be able to just use:This will depend on what exactly you’re trying to match and what format it is in, however.