本文介绍了Objective-C Cocoa应用程序中的正则表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

初始Googling表示在Objective-C Cocoa应用程序中没有内置方法来执行正则表达式。



这四个问题:

$ b


  • 这是真的吗?


  • 好的,那么是否有一个很好的开源库?



  • 解决方案

    p>我注意到,从iOS 4.0苹果提供了。此外,从10.7开始,该类可用。


    Initial Googling indicates that there's no built-in way to do regular expressions in an Objective-C Cocoa application.

    So four questions:

    1. Is that really true?

    2. Are you kidding me?

    3. Ok, then is there a nice open-source library you recommend?

    4. What are ways to get close enough without importing a library, perhaps with the NSScanner class?

    解决方案

    I noticed that as of iOS 4.0 Apple provides a NSRegularExpression class. Additionally, as of 10.7, the class is available under OS X.

    这篇关于Objective-C Cocoa应用程序中的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

    08-21 14:31