Replace regexreplace docs typo with regex_replace
Signed-off-by: Jeremiah Snapp <jeremiah@chef.io>
This commit is contained in:
parent
3b9a0427cd
commit
3f2b8587b1
|
@ -50,7 +50,7 @@ export default [
|
||||||
'join',
|
'join',
|
||||||
'lower',
|
'lower',
|
||||||
'replace',
|
'replace',
|
||||||
'regexreplace',
|
'regex_replace',
|
||||||
'split',
|
'split',
|
||||||
'strrev',
|
'strrev',
|
||||||
'substr',
|
'substr',
|
||||||
|
|
|
@ -1,21 +1,21 @@
|
||||||
---
|
---
|
||||||
layout: docs
|
layout: docs
|
||||||
page_title: regexreplace - Functions - Configuration Language
|
page_title: regex_replace - Functions - Configuration Language
|
||||||
sidebar_title: regexreplace
|
sidebar_title: regex_replace
|
||||||
description: |-
|
description: |-
|
||||||
The regexreplace function searches a given string for another given substring,
|
The regex_replace function searches a given string for another given substring,
|
||||||
and replaces all occurrences with a given replacement string. The substring
|
and replaces all occurrences with a given replacement string. The substring
|
||||||
argument can be a valid regular expression or a string.
|
argument can be a valid regular expression or a string.
|
||||||
---
|
---
|
||||||
|
|
||||||
# `regexreplace` Function
|
# `regex_replace` Function
|
||||||
|
|
||||||
`regexreplace` searches a given string for another given substring, and
|
`regex_replace` searches a given string for another given substring, and
|
||||||
replaces each occurrence with a given replacement string. The substring
|
replaces each occurrence with a given replacement string. The substring
|
||||||
argument can be a valid regular expression or a string.
|
argument can be a valid regular expression or a string.
|
||||||
|
|
||||||
```hcl
|
```hcl
|
||||||
regexreplace(string, substring, replacement)
|
regex_replace(string, substring, replacement)
|
||||||
```
|
```
|
||||||
|
|
||||||
`substring` should not be wrapped in forward slashes, it is always treated as a
|
`substring` should not be wrapped in forward slashes, it is always treated as a
|
||||||
|
@ -26,17 +26,17 @@ name of a capture group.
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
```shell-session
|
```shell-session
|
||||||
> regexreplace("hello world", "world", "everybody")
|
> regex_replace("hello world", "world", "everybody")
|
||||||
hello everybody
|
hello everybody
|
||||||
|
|
||||||
|
|
||||||
> regexreplace("hello world", "w.*d", "everybody")
|
> regex_replace("hello world", "w.*d", "everybody")
|
||||||
hello everybody
|
hello everybody
|
||||||
|
|
||||||
> regexreplace("-ab-axxb-", "a(x*)b", "$1W)
|
> regex_replace("-ab-axxb-", "a(x*)b", "$1W)
|
||||||
---
|
---
|
||||||
|
|
||||||
> regexreplace("-ab-axxb-", "a(x*)b", "${1}W")
|
> regex_replace("-ab-axxb-", "a(x*)b", "${1}W")
|
||||||
-W-xxW-
|
-W-xxW-
|
||||||
```
|
```
|
||||||
|
|
|
@ -28,5 +28,5 @@ hello everybody
|
||||||
|
|
||||||
## Related Functions
|
## Related Functions
|
||||||
|
|
||||||
- [`regexreplace`](/docs/from-1.5/functions/string/regexreplace) searches a given string for another given substring,
|
- [`regex_replace`](/docs/from-1.5/functions/string/regex_replace) searches a given string for another given substring,
|
||||||
and replaces each occurrence with a given replacement string.
|
and replaces each occurrence with a given replacement string.
|
||||||
|
|
Loading…
Reference in New Issue