---
title: Search and replace in strings
summary: Use regular expression substitution functions to map paths, strip extraneous slashes, and more.
url: https://www.fastly.com/documentation/solutions/examples/search-and-replace-in-strings
---

Use regular expression substitution functions to map paths, strip extraneous slashes, and more.

## VCL

[Try it in Fastly Fiddle](https://fiddle.fastly.dev/43e7c351)

## Compute

### Rust

[Try it in Fastly Fiddle](https://fiddle.fastly.dev/f4f55e2e)

### Javascript

[Try it in Fastly Fiddle](https://fiddle.fastly.dev/9703eeb9)

### Go

[Try it in Fastly Fiddle](https://fiddle.fastly.dev/83fc5b60)

