Hrm. Makes sense. However, I just thought of something. There were two expressions like that, and while the first one had trouble, the second one didn't. That is, I didn't have to group the " on the second expression.
The second one was at the end of the expression - if it had matched the zero width alternative then the overall match would have been shorter. Here's another alternative expression that I think does what you want: const char* badPatternStr = "]*name=\"?([^> \"]*)\"?[[:space:]][^>]*value=\"?([^> \"]+)"; Note the extra \"?[[:space:]] after the matched text - I think that will work, there does have to be one or more spaces between attributes doesn't there? John Maddock http://ourworld.compuserve.com/homepages/john_maddock/index.htm