gpt4 book ai didi

regex - 使用 QRegularExpression 的不区分大小写的搜索模式

转载 作者:行者123 更新时间:2023-12-04 15:54:32 26 4
gpt4 key购买 nike

这个问题是这个问题的扩展: How to replace QRegExp in a string?

在那个问题中,问题就解决了。但是现在我需要使用 QRegularExpression 而不是 QRegExp。我应该如何转移 Toby Speight 的答案?

最佳答案

QRegExp使用 Qt::CaseInsensitive 启用不区分大小写的搜索模式.

当您使用 QRegularExpression 时基于 PCRE 正则表达式引擎,你可以使用 QRegularExpression::CaseInsensitiveOption :

The pattern should match against the subject string in a case insensitive way. This option corresponds to the /i modifier in Perl regular expressions.

关于regex - 使用 QRegularExpression 的不区分大小写的搜索模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52327061/

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