Skip to content
This repository was archived by the owner on Apr 12, 2022. It is now read-only.
This repository was archived by the owner on Apr 12, 2022. It is now read-only.

ReplaceText does not work with regex #59

@scottone

Description

@scottone

I can find text using a Regex (Paragraph.FindAllByPattern function) but
cannot replace text with a Regex (Paragraph.ReplaceText function). Am I missing something?

This matches the text:
$WordDocument.Paragraphs[2].FindAllByPattern('E.*?e',[System.Text.RegularExpressions.RegexOptions]::None)

This uses the same pattern but does not do the replacement:
$WordDocument.Paragraphs[2].ReplaceText('E.*?e','Awesomeness', $false, [System.Text.RegularExpressions.RegexOptions]::None)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions