1. Packages
  2. String
  3. API Docs
  4. regexp
  5. replace
String v1.0.0 published on Friday, Oct 28, 2022 by Pulumi

str.regexp.replace

Explore with Pulumi AI

str logo
String v1.0.0 published on Friday, Oct 28, 2022 by Pulumi

    A regex based replace on a string.

    The underlying regexp engine is the go “regexp” stdlib package. You can see details at for available patterns at https://pkg.go.dev/regexp/syntax.

    Using replace

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function replace(args: ReplaceArgs, opts?: InvokeOptions): Promise<ReplaceResult>
    function replaceOutput(args: ReplaceOutputArgs, opts?: InvokeOptions): Output<ReplaceResult>
    def replace(new: Optional[str] = None,
                old: Optional[str] = None,
                string: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> ReplaceResult
    def replace_output(new: Optional[pulumi.Input[str]] = None,
                old: Optional[pulumi.Input[str]] = None,
                string: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[ReplaceResult]
    func Replace(ctx *Context, args *ReplaceArgs, opts ...InvokeOption) (*ReplaceResult, error)
    func ReplaceOutput(ctx *Context, args *ReplaceOutputArgs, opts ...InvokeOption) ReplaceResultOutput

    > Note: This function is named Replace in the Go SDK.

    public static class Replace 
    {
        public static Task<ReplaceResult> InvokeAsync(ReplaceArgs args, InvokeOptions? opts = null)
        public static Output<ReplaceResult> Invoke(ReplaceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<ReplaceResult> replace(ReplaceArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: str:regexp:replace
      arguments:
        # arguments dictionary

    The following arguments are supported:

    New string

    The new string.

    Note: Inside repl, "$" signs are interpreted as an Expand, so for instance $1 represents the text of the first submatch.

    Old string
    The regular expression to match against.
    String string
    The string to operate over.
    New string

    The new string.

    Note: Inside repl, "$" signs are interpreted as an Expand, so for instance $1 represents the text of the first submatch.

    Old string
    The regular expression to match against.
    String string
    The string to operate over.
    new_ String

    The new string.

    Note: Inside repl, "$" signs are interpreted as an Expand, so for instance $1 represents the text of the first submatch.

    old String
    The regular expression to match against.
    string String
    The string to operate over.
    new string

    The new string.

    Note: Inside repl, "$" signs are interpreted as an Expand, so for instance $1 represents the text of the first submatch.

    old string
    The regular expression to match against.
    string string
    The string to operate over.
    new str

    The new string.

    Note: Inside repl, "$" signs are interpreted as an Expand, so for instance $1 represents the text of the first submatch.

    old str
    The regular expression to match against.
    string str
    The string to operate over.
    new String

    The new string.

    Note: Inside repl, "$" signs are interpreted as an Expand, so for instance $1 represents the text of the first submatch.

    old String
    The regular expression to match against.
    string String
    The string to operate over.

    replace Result

    The following output properties are available:

    Result string
    The input "string" where each pattern matching "old" is replaced by "new".
    Result string
    The input "string" where each pattern matching "old" is replaced by "new".
    result String
    The input "string" where each pattern matching "old" is replaced by "new".
    result string
    The input "string" where each pattern matching "old" is replaced by "new".
    result str
    The input "string" where each pattern matching "old" is replaced by "new".
    result String
    The input "string" where each pattern matching "old" is replaced by "new".

    Package Details

    Repository
    str pulumi/pulumi-str
    License
    str logo
    String v1.0.0 published on Friday, Oct 28, 2022 by Pulumi