Pesquisar e substituir usando uma expressão regular
Pesquisar e substituir em vários arquivos usando expressões regulares na visualização “ Search Results ”.
As expressões regulares usadas no ` Qt Creator ` seguem o modelo das expressões regulares do Perl. Para obter mais informações sobre o uso de expressões regulares, consulte QRegularExpression.
Por exemplo, para substituir verificações de igualdade (foo == bar) por uma função (foo.equals(bar)):
- Envie suas alterações para o controle de versão, pois não é possível desfazer a ação de substituição.
- Pressione Ctrl+Shift+F ou acesse Edit > Find/Replace > Advanced Find > Open Advanced Find para abrir Search Results.

- Em Scope, selecione a opção mais adequada para sua pesquisa.
- Selecione Use regular expressions.
- Digite o seguinte texto em Search for:
if \((.*) == (.*)\)
- Selecione “ Search & Replace ” para ver uma lista de resultados da pesquisa.

- Em “ Replace with ”, digite o seguinte texto:
if (\1.strictlyEquals(\2))
- Selecione “ Replace ” para substituir todas as ocorrências do texto.
Veja também Como: Editar código, Como: Pesquisar e Edição de código.
Copyright © The Qt Company Ltd. and other contributors. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.