> ## Documentation Index
> Fetch the complete documentation index at: https://docs.kasoftware.com/llms.txt
> Use this file to discover all available pages before exploring further.

# arc:case

> 在 arc:select 中定义条件分支，当选择值与 case 值匹配时执行，并支持精确、正则和 glob 匹配。

export const siteNameShort = "知行之桥";

arc:case 关键字和 [arc:select](./op-arc-select) 关键字一起使用。arc:case 关键字由一个 {siteNameShort}Script 块组成，只有当 [arc:select](./op-arc-select) 中的值与 arc:case 中的值匹配时才会执行。

## 参数

* **value**：与 [arc:select](./op-arc-select) 中指定的值进行比较的模式或值。
* **match**：匹配的类型，用于确定是否应执行 case 语句。默认值是 “exact”, 需要值完全匹配。其它支持的类型有 “regex”，用作正则表达式匹配，以及 “glob”，支持一种简单的表达式模型，和文件名模式中使用的类似（例如 \*.txt）。应用程序的 .NET 版本使用 .NET 框架版本的正则表达式匹配。Java 版本使用 Java 正则表达式构造。

## 控制属性

无

## 示例

根据条件显示图标。arc:case 元素与 company\_name 属性中的 `CompanyA` 和 `CompanyB` 进行匹配，如果发现任何匹配项，就会采取与该项关联的操作。

```xml theme={null}
<arc:select value="[company_name]">
  <arc:case value="CompanyA">
    <img src="http://www.companya.com/favicon.ico" />
  </arc:case>
  <arc:case value="CompanyB">
    <img src="http://www.companyb.com/favicon.ico" />
  </arc:case>
  <arc:default>
    <img src="http://www.myhosting.com/generic.ico"/>
  </arc:default>
</arc:select>
```

## 另请参阅

* [arc:select](./op-arc-select)：编写一个多选 {siteNameShort}Script 块。
* [arc:default](./op-arc-default)：为 [arc:select](./op-arc-select) 编写一个默认的情况。
