Objective-C Cocoa 应用程序中的正则表达式 [英] Regular expressions in an Objective-C Cocoa application

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

问题描述

初始谷歌搜索表明在 Objective-C Cocoa 应用程序中没有内置的方法来执行正则表达式.

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

所以四个问题:

  1. 这是真的吗?

  1. Is that really true?

你在开玩笑吗?

好的,那么您有什么好的开源库推荐吗?

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

有什么方法可以在不导入库的情况下获得足够的接近度,也许使用 NSScanner 类?

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

推荐答案

我注意到从 iOS 4.0 开始,Apple 提供了一个 NSRegularExpression 类.此外,从 10.7 开始,该类在 下可用OS X.

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 应用程序中的正则表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆