Skip to content

Warning

You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?

Replace string

Actions
Use regular expressions to manipulate strings
v1.3
Star (18)

Tags

 (1)

replace-string GitHub Action

Replaces strings with regular expressions.

Inputs

pattern

Required Regular expression to match.

string

Required Input string.

replace-with

Required String to use for replacement.

flags

Flags to use when matching. Please refer to MDN for more information.

json

Boolean. Interprets replace-with as JSON data. Useful for when replace-with contains leading or trailing whitespace that would be trimmed away by GitHub.

Outputs

replaced

The replaced string.

Example usage

uses: frabert/[email protected]
with:
  pattern: 'Hello, (\w+)!'
  string: 'Hello, world!'
  replace-with: 'I greet you, $1!'

Replace string is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.

About

Use regular expressions to manipulate strings
v1.3

Tags

 (1)

Replace string is not certified by GitHub. It is provided by a third-party and is governed by separate terms of service, privacy policy, and support documentation.