gpt4 book ai didi

java rowfilter 正则表达式 区域设置

转载 作者:行者123 更新时间:2023-11-30 05:57:13 29 4
gpt4 key购买 nike

我有一个填充的 JTable 并有一个不区分大小写的行过滤器:

RowFilter rf = RowFilter.regexFilter("(?i)"+filterText.getText(), 0);

在使用本地化字母并在 JTextfield 中输入 åäöÅäÖ 之前,此功能正常工作。这些字母不区分大小写。

有人知道如何使正则表达式过滤器使用本地化字母吗?

最佳答案

根据我的评论回答这个问题:

如果您使用 UNICODE_CASE 标记您的Pattern选项与不区分大小写的选项一起,您应该得到您需要的结果。

由于这是一个构造模式,因此只需在前面添加 (?iu) 而不是仅添加 (?i)

作为引用,文档中提到了 UNICODE_CASE 标志...

Enables Unicode-aware case folding.

When this flag is specified then case-insensitive matching, whenenabled by the CASE_INSENSITIVE flag, is done in a manner consistentwith the Unicode Standard. By default, case-insensitive matchingassumes that only characters in the US-ASCII charset are beingmatched.

Unicode-aware case folding can also be enabled via the embedded flagexpression (?u).

Specifying this flag may impose a performance penalty.

关于java rowfilter 正则表达式 区域设置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52952825/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com