gpt4 book ai didi

ios - Xamarin 中的 NSRegularExpression 类

转载 作者:塔克拉玛干 更新时间:2023-11-02 09:38:52 25 4
gpt4 key购买 nike

谁能建议我如何在 Xamarin iOS 中使用 NSRegularExpression 类。我无法在 Xamarin Studio 中使用它,寻找以下方法的等效方法

   NSArray* matches = [[NSRegularExpression regularExpressionWithPattern:expression options:NSRegularExpressionDotMatchesLineSeparators error:nil] matchesInString:string options:0 range:range];

最佳答案

您可以使用 Regex.Matches(String,String,RegexOptions)

Searches the specified input string for all occurrences of a specified regular expression, using the specified matching options.

NSRegularExpressionDotMatchesLineSeparators 与可以添加到模式开头的内联选项 (?s) 相同,或者使用 RegexOptions.Singleline 标记为 Regex.Matches

关于ios - Xamarin 中的 NSRegularExpression 类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35840680/

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