Set two flags in Java regex.Pattern

前端 未结 4 841
慢半拍i
慢半拍i 2020-12-28 13:38

I need a matcher like this:

Matcher kuchen = Pattern.compile(\"gibt es Kuchen in der K\\u00FCche\",Pattern.CASE_INSENSITIVE).matcher(\"\");

相关标签:
4条回答
  • 2020-12-28 14:13

    Try

    Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE
    

    it should solve the issue. Or-ing the bitmask you will get compound features.

    0 讨论(0)
  • 2020-12-28 14:15

    Use bitwise OR, like Pattern.CASE_INSENSITIVE | Pattern.UNICODE_CASE.

    0 讨论(0)
  • 2020-12-28 14:34

    It's a bitmask, so you use the bitwise OR operator |.

    0 讨论(0)
  • 2020-12-28 14:40

    Though more pure using parameters, same as "(?iu)gibt es ..." without parameters. i = case-insensitive, u = unicode.

    0 讨论(0)
提交回复
热议问题