Skip to content

Commit 8a4e77b

Browse files
authored
Merge pull request #46695 from kechigon/main
Correction of CEL sample code.
2 parents 772bcce + a0a7c71 commit 8a4e77b

File tree

1 file changed

+3
-3
lines changed
  • content/en/docs/reference/using-api

1 file changed

+3
-3
lines changed

content/en/docs/reference/using-api/cel.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ Examples:
133133
{{< table caption="Examples of CEL expressions using regex library functions" >}}
134134
| CEL Expression | Purpose |
135135
|-------------------------------------------------------------|----------------------------------------------------------|
136-
| `"abc 123".find('[0-9]*')` | Find the first number in a string |
137-
| `"1, 2, 3, 4".findAll('[0-9]*').map(x, int(x)).sum() < 100` | Verify that the numbers in a string sum to less than 100 |
136+
| `"abc 123".find('[0-9]+')` | Find the first number in a string |
137+
| `"1, 2, 3, 4".findAll('[0-9]+').map(x, int(x)).sum() < 100` | Verify that the numbers in a string sum to less than 100 |
138138
{{< /table >}}
139139

140140
See the [Kubernetes regex library](https://pkg.go.dev/k8s.io/apiextensions-apiserver/pkg/apiserver/schema/cel/library#Regex)
@@ -239,7 +239,7 @@ Examples:
239239
| `quantity("500000G").isInteger()` | Test if conversion to integer would throw an error |
240240
| `quantity("50k").asInteger()` | Precise conversion to integer |
241241
| `quantity("9999999999999999999999999999999999999G").asApproximateFloat()` | Lossy conversion to float |
242-
| `quantity("50k").add("20k")` | Add two quantities |
242+
| `quantity("50k").add(quantity("20k"))` | Add two quantities |
243243
| `quantity("50k").sub(20000)` | Subtract an integer from a quantity |
244244
| `quantity("50k").add(20).sub(quantity("100k")).sub(-50000)` | Chain adding and subtracting integers and quantities |
245245
| `quantity("200M").compareTo(quantity("0.2G"))` | Compare two quantities |

0 commit comments

Comments
 (0)