Compartilhar via


Método IEditorOperations.ReplaceAllMatches

Substitui todas as ocorrências de correspondência de determinada seqüência de caracteres.

Namespace:  Microsoft.VisualStudio.Text.Operations
Assembly:  Microsoft.VisualStudio.Text.UI (em Microsoft.VisualStudio.Text.UI.dll)

Sintaxe

'Declaração
Function ReplaceAllMatches ( _
    searchText As String, _
    replaceText As String, _
    matchCase As Boolean, _
    matchWholeWord As Boolean, _
    useRegularExpressions As Boolean _
) As Integer
int ReplaceAllMatches(
    string searchText,
    string replaceText,
    bool matchCase,
    bool matchWholeWord,
    bool useRegularExpressions
)
int ReplaceAllMatches(
    String^ searchText, 
    String^ replaceText, 
    bool matchCase, 
    bool matchWholeWord, 
    bool useRegularExpressions
)
abstract ReplaceAllMatches : 
        searchText:string * 
        replaceText:string * 
        matchCase:bool * 
        matchWholeWord:bool * 
        useRegularExpressions:bool -> int
function ReplaceAllMatches(
    searchText : String, 
    replaceText : String, 
    matchCase : boolean, 
    matchWholeWord : boolean, 
    useRegularExpressions : boolean
) : int

Parâmetros

  • searchText
    Tipo: String

    O texto para coincidir.

  • replaceText
    Tipo: String

    O texto de substituição.

  • matchCase
    Tipo: Boolean

    trueSe a pesquisa deve coincidir com os casos, caso contrário, false.

  • matchWholeWord
    Tipo: Boolean

    trueSe a pesquisa deve corresponder a palavras inteiras, caso contrário, false.

  • useRegularExpressions
    Tipo: Boolean

    trueSe a pesquisa deve usar expressões regulares, caso contrário, false.

Valor de retorno

Tipo: Int32
O número de correspondências encontradas.

Exceções

Exceção Condição
ArgumentNullException

searchText é nulluma referência nula (Nothing no Visual Basic).

ArgumentException

useRegularExpressionsé true e searchText é uma expressão regular inválida.

Comentários

Se qualquer uma das correspondências encontradas é somente leitura, nenhuma das correspondências serão substituídas.

Segurança do .NET Framework

Consulte também

Referência

IEditorOperations Interface

Namespace Microsoft.VisualStudio.Text.Operations