Skip to content

Commit a630a11

Browse files
authored
Merge pull request #46767 from kechigon/main
[zh]update cel.md
2 parents 54ac78e + b99d5f9 commit a630a11

File tree

1 file changed

+7
-7
lines changed
  • content/zh-cn/docs/reference/using-api

1 file changed

+7
-7
lines changed

content/zh-cn/docs/reference/using-api/cel.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -257,15 +257,15 @@ Examples:
257257
{{< table caption="Examples of CEL expressions using regex library functions" >}}
258258
| CEL Expression | Purpose |
259259
|-------------------------------------------------------------|----------------------------------------------------------|
260-
| `"abc 123".find('[0-9]*')` | Find the first number in a string |
261-
| `"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 |
260+
| `"abc 123".find('[0-9]+')` | Find the first number in a string |
261+
| `"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 |
262262
{{< /table >}}
263263
-->
264264
{{< table caption="使用正则表达式库函数的 CEL 表达式例子" >}}
265265
| CEL 表达式 | 用途 |
266266
|-------------------------------------------------------------|----------------------------|
267-
| `"abc 123".find('[0-9]*')` | 找到字符串中的第一个数字 |
268-
| `"1, 2, 3, 4".findAll('[0-9]*').map(x, int(x)).sum() < 100` | 验证字符串中的数字之和小于 100 |
267+
| `"abc 123".find('[0-9]+')` | 找到字符串中的第一个数字 |
268+
| `"1, 2, 3, 4".findAll('[0-9]+').map(x, int(x)).sum() < 100` | 验证字符串中的数字之和小于 100 |
269269
{{< /table >}}
270270

271271
<!--
@@ -476,8 +476,8 @@ Examples:
476476
|---------------------------------------------------------------------------|-------------------------------------------------------|
477477
| `quantity("500000G").isInteger()` | Test if conversion to integer would throw an error |
478478
| `quantity("50k").asInteger()` | Precise conversion to integer |
479-
| `quantity("9999999999999999999999999999999999999G").asApproximateFloat()` | Lossy conversion to float |
480-
| `quantity("50k").add("20k")` | Add two quantities |
479+
| `quantity("9999999999999999999999999999999999999G").asApproximateFloat()` | Lossy conversion to float |
480+
| `quantity("50k").add(quantity("20k"))` | Add two quantities |
481481
| `quantity("50k").sub(20000)` | Subtract an integer from a quantity |
482482
| `quantity("50k").add(20).sub(quantity("100k")).sub(-50000)` | Chain adding and subtracting integers and quantities |
483483
| `quantity("200M").compareTo(quantity("0.2G"))` | Compare two quantities |
@@ -491,7 +491,7 @@ Examples:
491491
| `quantity("500000G").isInteger()` | 测试转换为整数是否会报错 |
492492
| `quantity("50k").asInteger()` | 精确转换为整数 |
493493
| `quantity("9999999999999999999999999999999999999G").asApproximateFloat()` | 松散转换为浮点数 |
494-
| `quantity("50k").add("20k")` | 两个数量相加 |
494+
| `quantity("50k").add(quantity("20k"))` | 两个数量相加 |
495495
| `quantity("50k").sub(20000)` | 从数量中减去整数 |
496496
| `quantity("50k").add(20).sub(quantity("100k")).sub(-50000)` | 链式相加和减去整数和数量 |
497497
| `quantity("200M").compareTo(quantity("0.2G"))` | 比较两个数量 |

0 commit comments

Comments
 (0)