mirror of
https://github.com/mikefarah/yq.git
synced 2026-07-10 08:35:42 +00:00
Change "golang regex" to "Golang's regex"
This commit is contained in:
parent
3399f1fa01
commit
18a5861477
@ -298,7 +298,7 @@ false
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Substitute / Replace string
|
## Substitute / Replace string
|
||||||
This uses golang regex, described [here](https://github.com/google/re2/wiki/Syntax)
|
This uses Golang's regex, described [here](https://github.com/google/re2/wiki/Syntax)
|
||||||
Note the use of `|=` to run in context of the current string value.
|
Note the use of `|=` to run in context of the current string value.
|
||||||
|
|
||||||
Given a sample.yml file of:
|
Given a sample.yml file of:
|
||||||
@ -315,7 +315,7 @@ a: cats are great
|
|||||||
```
|
```
|
||||||
|
|
||||||
## Substitute / Replace string with regex
|
## Substitute / Replace string with regex
|
||||||
This uses golang regex, described [here](https://github.com/google/re2/wiki/Syntax)
|
This uses Golang's regex, described [here](https://github.com/google/re2/wiki/Syntax)
|
||||||
Note the use of `|=` to run in context of the current string value.
|
Note the use of `|=` to run in context of the current string value.
|
||||||
|
|
||||||
Given a sample.yml file of:
|
Given a sample.yml file of:
|
||||||
|
|||||||
@ -205,7 +205,7 @@ var stringsOperatorScenarios = []expressionScenario{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "Substitute / Replace string",
|
description: "Substitute / Replace string",
|
||||||
subdescription: "This uses golang regex, described [here](https://github.com/google/re2/wiki/Syntax)\nNote the use of `|=` to run in context of the current string value.",
|
subdescription: "This uses Golang's regex, described [here](https://github.com/google/re2/wiki/Syntax)\nNote the use of `|=` to run in context of the current string value.",
|
||||||
document: `a: dogs are great`,
|
document: `a: dogs are great`,
|
||||||
expression: `.a |= sub("dogs", "cats")`,
|
expression: `.a |= sub("dogs", "cats")`,
|
||||||
expected: []string{
|
expected: []string{
|
||||||
@ -214,7 +214,7 @@ var stringsOperatorScenarios = []expressionScenario{
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: "Substitute / Replace string with regex",
|
description: "Substitute / Replace string with regex",
|
||||||
subdescription: "This uses golang regex, described [here](https://github.com/google/re2/wiki/Syntax)\nNote the use of `|=` to run in context of the current string value.",
|
subdescription: "This uses Golang's regex, described [here](https://github.com/google/re2/wiki/Syntax)\nNote the use of `|=` to run in context of the current string value.",
|
||||||
document: "a: cat\nb: heat",
|
document: "a: cat\nb: heat",
|
||||||
expression: `.[] |= sub("(a)", "${1}r")`,
|
expression: `.[] |= sub("(a)", "${1}r")`,
|
||||||
expected: []string{
|
expected: []string{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user