Skip to content
| Marketplace
Sign in
Azure DevOps>Azure Pipelines>Pattern Match & Replacement
Pattern Match & Replacement

Pattern Match & Replacement

Akhil Sharma

|
6 installs
| (3) | Free
Task to search a pattern/variable in the given file and replace it with predefined value.
Get it free

Pattern Match & Replacement Extension

This Azure DevOps extension automates the process of replacing predefined patterns in files with specified values. This is particularly useful for dynamic configuration of files during build or release pipelines.

Features

  • Specify a file and replace patterns like #VARIABLE# (or anything of your choice) with desired values.
  • Fully configurable through Azure DevOps pipeline task inputs.
  • Supports both Build and Release pipelines.
  • CURRENTLY SUPPORTS ONLY SINGLE FILE BUT WILL BE SOON UPDATED TO SUPPORT MULTIPLE FILES!

Prerequisites

  • Azure DevOps Services or Azure DevOps Server
  • Appropriate permissions to add and run pipeline tasks

Usage

  1. Add the task Pattern Match & Replacement to your pipeline.
  2. Configure the following parameters:
    • File Path: Path to the file where replacements will occur.
    • Pattern: The regex or text pattern to replace (e.g., {{VARIABLE}}).
    • Replacement Value: The value to replace the pattern with.
  3. Run the pipeline to see the changes reflected in the file.

Example YAML

steps:
- task: <task-extension>@<version>
  inputs:
    filePath: 'config/settings.json'
    pattern: '{{VERSION}}'
    replacementValue: '1.0.0'

Usage Example

Support

For issues, feature requests, or questions, please create an issue in the GitHub repository or reach out at info@akhilsharma.top.

Contributing

This extension is maintained by Akhil Sharma. While the extension is free to use, any modifications, copies, or reuse of its code or functionality require prior written approval from the author.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft