The compilation issue is probably due to trying to escape the ampersand (\&
). But other than that, your regex is mostly right, just overusing character groups ([]
), they are not for grouping. This expression works in my tests: SW(.*)<br>
, so in your case you'd do something like
QRegExp rx(" SW(.*)<br>")