С бустом я бы использовал это простое регулярное выражение:
(.*?)(==|!=)(.*)
Редактировать: при условии , что выражение является строкой.
Редактировать 2: объяснение регулярного выражения
// (.*?)(==|!=)(.*)
//
// Match the regular expression below and capture its match into backreference number 1 «(.*?)»
// Match any single character that is not a line break character «.*?»
// Between zero and unlimited times, as few times as possible, expanding as needed (lazy) «*?»
// Match the regular expression below and capture its match into backreference number 2 «(==|!=)»
// Match either the regular expression below (attempting the next alternative only if this one fails) «==»
// Match the characters “==” literally «==»
// Or match regular expression number 2 below (the entire group fails if this one fails to match) «!=»
// Match the characters “!=” literally «!=»
// Match the regular expression below and capture its match into backreference number 3 «(.*)»
// Match any single character that is not a line break character «.*»
// Between zero and unlimited times, as many times as possible, giving back as needed (greedy) «*»