private String inString(Matcher matcher) {
    final String replacement =
        "(<foreach collection=\"$1\" item=\"__item\" separator=\",\" >\"#{__item}\"</foreach>)";
    String script = matcher.replaceAll(replacement);
    return "<script>" + script + "</script>";
  }
Mybatis language extensions, this diver will replace sql script like

<pre>
 select * from tbl where id in (#{ids::number[]})
</pre>

to

<pre>
<script>
  select * from tbl where id in
   <foreach collection="items" item="item" separator="," open="(" close=")" >
     #{items}
   </foreach>
</script>
</pre>

<p>or replace sql script like

<pre>
 select * from tbl where id in (#{ids::string[]})
</pre>

to

<pre>
<script>
  select * from tbl where id in
   <foreach collection="items" item="item" separator="," open="(" close=")" >
     #{items}
   </foreach>
</script>
</pre>
amoro-ams/src/main/java/org/apache/amoro/server/persistence/extension/InListExtendedLanguageDriver.java