<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>peekay &#187; iPhone</title>
	<atom:link href="http://peekay.org/category/iphone/feed/" rel="self" type="application/rss+xml" />
	<link>http://peekay.org</link>
	<description>random stuff about software, infrastructure, security, etc</description>
	<lastBuildDate>Mon, 26 Mar 2012 22:07:22 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='peekay.org' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>peekay &#187; iPhone</title>
		<link>http://peekay.org</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://peekay.org/osd.xml" title="peekay" />
	<atom:link rel='hub' href='http://peekay.org/?pushpress=hub'/>
		<item>
		<title>More fun with a locked iPhone 4</title>
		<link>http://peekay.org/2012/02/05/more-fun-with-locked-iphone-4/</link>
		<comments>http://peekay.org/2012/02/05/more-fun-with-locked-iphone-4/#comments</comments>
		<pubDate>Sun, 05 Feb 2012 13:52:08 +0000</pubDate>
		<dc:creator>Ade Barkah</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://peekay.org/?p=116</guid>
		<description><![CDATA[Perusing the private address book and making live video calls &#8212; all from a locked iPhone 4. Last time we explored how an incorrect time setting could expose your pictures on a locked iPhone.  Today we&#8217;ll have a bit more fun. Often when doing security work, you&#8217;re happy if you manage to leak just a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peekay.org&#038;blog=4701354&#038;post=116&#038;subd=peekay&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>Perusing the private address book and making live video calls &#8212; all from a locked iPhone 4.</em></p>
<p>Last time we explored how an <a href="http://peekay.org/2011/12/31/incorrect-time-setting-could-leak-ios-5-album-pictures/">incorrect time setting could expose your pictures</a> on a locked iPhone.  Today we&#8217;ll have a bit more fun.</p>
<p>Often when doing security work, you&#8217;re happy if you manage to leak just a single bit (yes, <strong>one</strong> binary digit) of encrypted material.  That one bit could be the tip of the iceberg, so to speak, which might lead to more secrets underneath.</p>
<p>Lets see how many bits of personal information we can gather from a locked, passcode-protected iPhone 4, without jailbreaking or using any special tools?</p>
<p>Below is a screenshot of my iPhone&#8217;s lock setup screen.  The settings are rather conservative: a long passcode is required immediately; and Voice Dial is <strong>DISABLED</strong> (when the screen is locked).</p>
<p style="text-align:center;"><a href="http://peekay.files.wordpress.com/2012/02/iphone-passcode-lock.png"><img class="aligncenter size-full wp-image-115" title="Passcode Lock Setup Screen" src="http://peekay.files.wordpress.com/2012/02/iphone-passcode-lock.png?w=500" alt=""   /></a><em>Passcode Lock setup screen</em></p>
<p style="text-align:left;"><strong>Note:</strong> I&#8217;m using an iPhone 4 (not 4s) with vanilla iOS 5.0.1 (the latest at this time).  I do not have Siri on this phone.</p>
<p>When the iPhone 3GS first came out, many were surprised that Voice Dial was enabled by default on their locked iPhones (<a href="http://news.cnet.com/8301-27080_3-20122632-245/bad-siri-shell-let-anyone-use-a-locked-iphone-4s/">and similarly, with Siri on the 4s</a>).  So for our exercise today, we made sure Voice Dial is turned off.</p>
<p>Voice dialing is accessed by long-pressing the phone&#8217;s home button.  Again I&#8217;ve disabled voice dialing, but a fine print on the setup screen above notes that &#8220;iPod Voice Control is always enabled&#8221; so it can still be used to play songs, etc.</p>
<p>Can we trick this restricted Voice Control to leak some private info, and perhaps trick it to make calls for us?  (Yes, we can!)</p>
<p>First let&#8217;s see how the Voice Dial restriction works.  I lock my phone, then long-press the home button until Voice Control appears.  I command it, &#8220;call &lt;Alice&gt;&#8221;.  The phone responds with &#8220;<strong>Voice Dialing is disabled</strong>&#8220;.   As it should.  All good, right?</p>
<p style="text-align:center;"><a href="http://peekay.files.wordpress.com/2012/02/iphone-voice-control.png"><img class="aligncenter size-full wp-image-114" title="Voice Control Screen" src="http://peekay.files.wordpress.com/2012/02/iphone-voice-control.png?w=500" alt=""   /></a><em>Voice Control screen</em></p>
<p style="text-align:left;">Now &#8220;slide to unlock&#8221; but instead of entering the passcode, hit the &#8220;Emergency Call&#8221; button (bottom-left).  We get this special emergency call screen:</p>
<p style="text-align:center;"><a href="http://peekay.files.wordpress.com/2012/02/iphone-emergency-call.png"><img class="aligncenter size-full wp-image-113" title="Emergency Call Screen" src="http://peekay.files.wordpress.com/2012/02/iphone-emergency-call.png?w=500" alt=""   /></a><em>Emergency Call screen</em></p>
<p>With this screen showing, I again bring up Voice Control, and repeat, &#8220;call &lt;Alice&gt;&#8221;.  This time the phone responds with &#8220;<strong>No match found</strong>&#8220;.  Hmm, different!!</p>
<p>Actually, that response in itself, my friends, is already a leak.  Voice Control reveals that I don&#8217;t have a contact named &#8220;Alice&#8221; in my Contacts.  One leaked privacy bit.</p>
<p>Just to test, let&#8217;s try with someone who&#8217;s actually in my address book, my friend <strong>Wayland</strong>.  I bring up Voice Control again from the Emergency Call screen and say &#8220;call &lt;Wayland&gt;&#8221;.</p>
<p style="text-align:center;"><a href="http://peekay.files.wordpress.com/2012/02/iphone-call-wayland.png"><img class="aligncenter size-full wp-image-112" title="Calling Wayland via Voice Control" src="http://peekay.files.wordpress.com/2012/02/iphone-call-wayland.png?w=500" alt=""   /></a><em>(Locked) Voice Control calling Wayland</em></p>
<p>Wow, it tries to dial out!  Although the call fails to actually connect, the screen reveals Wayland&#8217;s full name and that I have his mobile number.  Not a huge deal, but <strong>more leaked bits</strong>!</p>
<p>At this point, it&#8217;s easy for anyone to enumerate through the Contacts by simply trying common first names like Adam, Bob, Charles, etc.  Let&#8217;s see how far we can go.</p>
<p>Here&#8217;s an example when I say, &#8220;call &lt;Lisa&gt;&#8221;:</p>
<p style="text-align:center;"><a href="http://peekay.files.wordpress.com/2012/02/iphone-multiple-matches.png"><img class="aligncenter size-full wp-image-111" title="Multiple Matches for Name" src="http://peekay.files.wordpress.com/2012/02/iphone-multiple-matches.png?w=500" alt=""   /></a><em>Multiple matches shown for the name Lisa</em></p>
<p>Voice Control leaks that I have two Lisas in my contact list, one <strong>Lisa Atkins</strong> and one <strong>Lisa Klein</strong>**.  Repeating with &#8220;call &lt;Lisa Klein&gt;&#8221; yields further information:</p>
<p style="text-align:center;"><a href="http://peekay.files.wordpress.com/2012/02/iphone-multiple-numbers.png"><img class="aligncenter size-full wp-image-110" title="Multiple Numbers for Lisa Klein" src="http://peekay.files.wordpress.com/2012/02/iphone-multiple-numbers.png?w=500" alt=""   /></a><em>Multiple numbers listed for Lisa Klein</em></p>
<p>Now Voice Control leaks that I have two numbers for Lisa Klein: her &#8220;<strong>mobile</strong>&#8221; and another number at the &#8220;<strong>love shack</strong>&#8220;.  Had this been my jealous girlfriend probing my locked phone, I would&#8217;ve been totally busted!</p>
<p>Remember, we&#8217;re getting all this info from a locked phone with Voice Dial explicitly disabled.</p>
<p>So far we&#8217;ve only enumerated through the Contacts.  Can we actually complete a call from the locked phone?  With FaceTime, the answer is yes!</p>
<p>Again starting from the Emergency Call screen, this time I say, &#8220;FaceTime &lt;Lisa Klein&gt;&#8221;.  And Voice Control dutifully connects, to the love shack, with full two-way video live streaming.  Yikes!  Not what I&#8217;d expect from my locked phone!</p>
<p style="text-align:center;"><a href="http://peekay.files.wordpress.com/2012/02/iphone-facetime-lisa.png"><img class="aligncenter size-full wp-image-109" title="FaceTime Connecting to Lisa" src="http://peekay.files.wordpress.com/2012/02/iphone-facetime-lisa.png?w=500" alt=""   /></a><em>Lisa please don&#8217;t answer…</em></p>
<p>During testing, the FaceTime calls from my locked iPhone successfully connected and I was able to see + converse with the other party.  The test calls disconnected after a few minutes, but those disconnections might be due to the spotty internet service here at my hotel in Medellín, Colombia.</p>
<p><strong>Bottom line</strong>:  We&#8217;re able to trick Voice Control to enumerate through the private address book and make live FaceTime video calls on a locked iPhone 4, even with Voice Dial specifically disabled in the settings.</p>
<p>**Some names faked to protect the innocent.</p>
<p>Special thanks to <strong>Wayland Chan</strong> for helping me test FaceTime.</p>
<p>p.s. I have not tested this issue on the iPhone 3GS, which has Voice Control but lacks FaceTime.</p>
<p><strong><em>UPDATE</em></strong>: Feb 8, 2012:  While the iPhone attempts to connect the FaceTime call, it will show the contact&#8217;s <a href="http://techtips.salon.com/put-photos-contacts-iphone-266.html">profile picture</a> if any.  So a stranger using your iPhone could possibly see pictures of your contacts even if they do not have FaceTime enabled.</p>
<p><strong><em>UPDATE</em></strong>: Feb 9, 2012: <a href="http://news.cnet.com/8301-27076_3-57373491-248/iphone-bug-enables-facetime-shows-names-on-locked-phones/">CNET</a> also tested the bug on the iPhone 3GS and the iPhone 4S.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/peekay.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/peekay.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/peekay.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/peekay.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/peekay.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/peekay.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/peekay.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/peekay.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/peekay.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/peekay.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/peekay.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/peekay.wordpress.com/116/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/peekay.wordpress.com/116/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/peekay.wordpress.com/116/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peekay.org&#038;blog=4701354&#038;post=116&#038;subd=peekay&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://peekay.org/2012/02/05/more-fun-with-locked-iphone-4/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0846f908258a0d05752ee89a61da5d4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">peekay</media:title>
		</media:content>

		<media:content url="http://peekay.files.wordpress.com/2012/02/iphone-passcode-lock.png" medium="image">
			<media:title type="html">Passcode Lock Setup Screen</media:title>
		</media:content>

		<media:content url="http://peekay.files.wordpress.com/2012/02/iphone-voice-control.png" medium="image">
			<media:title type="html">Voice Control Screen</media:title>
		</media:content>

		<media:content url="http://peekay.files.wordpress.com/2012/02/iphone-emergency-call.png" medium="image">
			<media:title type="html">Emergency Call Screen</media:title>
		</media:content>

		<media:content url="http://peekay.files.wordpress.com/2012/02/iphone-call-wayland.png" medium="image">
			<media:title type="html">Calling Wayland via Voice Control</media:title>
		</media:content>

		<media:content url="http://peekay.files.wordpress.com/2012/02/iphone-multiple-matches.png" medium="image">
			<media:title type="html">Multiple Matches for Name</media:title>
		</media:content>

		<media:content url="http://peekay.files.wordpress.com/2012/02/iphone-multiple-numbers.png" medium="image">
			<media:title type="html">Multiple Numbers for Lisa Klein</media:title>
		</media:content>

		<media:content url="http://peekay.files.wordpress.com/2012/02/iphone-facetime-lisa.png" medium="image">
			<media:title type="html">FaceTime Connecting to Lisa</media:title>
		</media:content>
	</item>
		<item>
		<title>Incorrect time setting could leak iOS 5 album pictures</title>
		<link>http://peekay.org/2011/12/31/incorrect-time-setting-could-leak-ios-5-album-pictures/</link>
		<comments>http://peekay.org/2011/12/31/incorrect-time-setting-could-leak-ios-5-album-pictures/#comments</comments>
		<pubDate>Sat, 31 Dec 2011 23:03:12 +0000</pubDate>
		<dc:creator>Ade Barkah</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[security]]></category>

		<guid isPermaLink="false">http://peekay.org/?p=102</guid>
		<description><![CDATA[I always get a bit antsy about hacking researching vulnerabilities when I travel, and this time is no exception.  Often I notice &#8220;glitches&#8221; or abnormalities which I want to investigate, but since I&#8217;m in the middle of riding my motorcycle from Canada to Argentina, infosec has been on the back burner. Recently I took advantage [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peekay.org&#038;blog=4701354&#038;post=102&#038;subd=peekay&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I always get a bit antsy about <del>hacking</del> researching vulnerabilities when I travel, and this time is no exception.  Often I notice &#8220;glitches&#8221; or abnormalities which I want to investigate, but since I&#8217;m in the middle of riding my motorcycle <a href="http://www.advrider.com/forums/showthread.php?t=710505">from Canada to Argentina</a>, infosec has been on the back burner.</p>
<p>Recently I took advantage of great wi-fi in Costa Rica to <em>finally</em> upgrade my iPhone 4 to iOS 5.   Double-clicking the home button now allows one to quickly access the Camera app even from a locked phone:</p>
<p style="text-align:center;"><a href="http://peekay.files.wordpress.com/2011/12/iphone-unlock-screen.png"><img class="size-full wp-image-101 aligncenter" title="The Camera icon is now accessible from a locked iPhone" src="http://peekay.files.wordpress.com/2011/12/iphone-unlock-screen.png?w=500" alt=""   /></a><em>The camera icon (bottom-right) is now accessible from a locked iPhone</em></p>
<p>Since the camera is locked, Camera app has a smart feature barring access to the iPhone&#8217;s album.  You can only see pictures taken from the current (locked) session.</p>
<p>As an aside, I thought I noticed a glitch whereby I could completely bypass the passcode lock, but turns out it&#8217;s just poor UI from Apple.  (There&#8217;s a state where the phone is locked but a passcode is not yet required, and the UI during this period can be misleading.)   I changed the passcode setting to &#8220;immediate&#8221; after that.</p>
<p style="text-align:center;"><a href="http://peekay.files.wordpress.com/2011/12/iphone-locked-album.png"><img class="size-full wp-image-100 aligncenter" title="UI restricting album access from locked phone" src="http://peekay.files.wordpress.com/2011/12/iphone-locked-album.png?w=500" alt=""   /></a><em>UI barring access to album pictures from locked phone</em></p>
<p>While researching the above &#8220;glitch&#8221;, I was intrigued at how the Camera app&#8217;s album manager was able to segregate your &#8220;protected&#8221; images vs. the ones from the current session.  It&#8217;s like a &#8220;jail&#8221; for images.  I wondered if I could break out of this image jail.</p>
<p>Turns out Apple&#8217;s restriction is just a simple filter based on <em>the timestamp when the Camera app was invoked</em>.  You&#8217;re allowed to see all images with a timestamp greater than this invocation time.  Yet that leads to an immediate hole: if your iPhone&#8217;s clock ever rolls back, then all images with timestamps newer than your iPhone&#8217;s clock will be viewable from your locked phone.</p>
<p>But time always moves forward, right? Why would your phone&#8217;s clock ever roll backwards?</p>
<ul>
<li>It could be due to user error.  E.g., maybe while traveling across timezones you accidentally set the iPhone&#8217;s date or time incorrectly (rather than simply resetting the timezone).   If you set the clock ahead of what it&#8217;s supposed to be, then this vulnerability will appear when you reset to the correct time.  If you accidentally set the clock to the past, then your images will immediately become unprotected.</li>
<li>It could be an iPhone glitch.  E.g., a software or hardware issue could reset your iPhone&#8217;s clock to epoch time &#8212; iPhone&#8217;s &#8220;zero&#8221; time at midnight January 1, 2001.  In this case all your images are exposed.</li>
<li>It could be an infrastructure error.  E.g., if you automatically sync from a erroneous external time source (cell phone company, etc.)</li>
</ul>
<p>I don&#8217;t think normal (non-Apple) apps can change the iPhone&#8217;s clock, but if it can then that could be another possible source of rollback.</p>
<p>This vulnerability is simple to test.  Just set your iPhone&#8217;s clock to a time in the past (say, in 2010).  Then access the Camera while your phone is still locked.  Lo-and-behold, you&#8217;ll be able to see all your &#8220;protected&#8221; images.</p>
<p>The point to all this is that Apple should not rely on a simple timestamp to restrict image access.  Changing the iPhone&#8217;s clock &#8212; forwards or backwards &#8212; <em>should not</em> affect its security.  We can&#8217;t guarantee the clock will always monotonically more forward, and when it doesn&#8217;t, the system should fail-secure.</p>
<p>In the big picture, if real &#8220;bad guys&#8221; have physical access to your phone, then the game is over already.  However, as I wrote previously, <a href="peekay.org/2009/03/23/chinks-in-the-armor/">defense-in-depth</a> is a basic concept which should always be applied.</p>
<p>In various occasions I&#8217;ve advised clients to secure their time servers, etc., in the context of esoteric cryptographic attacks, audit logging, and other protocols which depend on accurate timekeeping.  I&#8217;m a bit amused that the iPhone is vulnerable to a simple time change.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/peekay.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/peekay.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/peekay.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/peekay.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/peekay.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/peekay.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/peekay.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/peekay.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/peekay.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/peekay.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/peekay.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/peekay.wordpress.com/102/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/peekay.wordpress.com/102/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/peekay.wordpress.com/102/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peekay.org&#038;blog=4701354&#038;post=102&#038;subd=peekay&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://peekay.org/2011/12/31/incorrect-time-setting-could-leak-ios-5-album-pictures/feed/</wfw:commentRss>
		<slash:comments>24</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0846f908258a0d05752ee89a61da5d4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">peekay</media:title>
		</media:content>

		<media:content url="http://peekay.files.wordpress.com/2011/12/iphone-unlock-screen.png" medium="image">
			<media:title type="html">The Camera icon is now accessible from a locked iPhone</media:title>
		</media:content>

		<media:content url="http://peekay.files.wordpress.com/2011/12/iphone-locked-album.png" medium="image">
			<media:title type="html">UI restricting album access from locked phone</media:title>
		</media:content>
	</item>
		<item>
		<title>iPhone SDK Regular Expressions</title>
		<link>http://peekay.org/2009/03/18/iphone-sdk-regular-expressions/</link>
		<comments>http://peekay.org/2009/03/18/iphone-sdk-regular-expressions/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 02:49:28 +0000</pubDate>
		<dc:creator>Ade Barkah</dc:creator>
				<category><![CDATA[iPhone]]></category>
		<category><![CDATA[regex]]></category>

		<guid isPermaLink="false">http://peekay.wordpress.com/?p=22</guid>
		<description><![CDATA[If you&#8217;re programming the iPhone, sooner or later you&#8217;ll need regular expressions (regex).  By default OS X includes the ICU, an open source Unicode library which has extensive regex capabilities. The ICU APIs are in C/C++ however, not Objective-C.   Fear not, RegexKitLite to the rescue.   This small library has done all the hard work [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peekay.org&#038;blog=4701354&#038;post=22&#038;subd=peekay&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re programming the iPhone, sooner or later you&#8217;ll need regular expressions (regex).  By default OS X includes the <a title="International Components for Unicode" href="http://site.icu-project.org/">ICU</a>, an open source Unicode library which has extensive regex capabilities.</p>
<p>The ICU APIs are in C/C++ however, not Objective-C.    Fear not, <a href="http://regexkit.sourceforge.net/RegexKitLite/index.html">RegexKitLite</a> to the rescue.   This small library has done all the hard work of adding regex methods to NSString.  RegexKitLite is small, thread-safe, and quite fast.  It simply links to ICU &#8211;  unlike its bigger brother, RegexKit, which must be compiled against <a title="Perl Compatible Regular Expressions" href="http://www.pcre.org/">PCRE</a>.</p>
<p>RegexKitLite is also easy to use:</p>
<pre style="padding-left:30px;">#import "RegexKitLite.h"
NSString * foo = @"some string to search on";
NSString * regex = @"^(.+?)\s";
NSLog(@"Match: %@", [foo stringByMatching:regex capture:1]);</pre>
<p>Then just link with -<em>licucore </em>and that&#8217;s it!!</p>
<p>Note: In Xcode I simply added <em>-licucore</em> to the &#8220;Other Linker Flags&#8221; in my project&#8217;s build configuration.  Maybe there&#8217;s a &#8220;better&#8221; way of doing this but this method works for me.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/peekay.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/peekay.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/peekay.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/peekay.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/peekay.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/peekay.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/peekay.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/peekay.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/peekay.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/peekay.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/peekay.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/peekay.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/peekay.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/peekay.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=peekay.org&#038;blog=4701354&#038;post=22&#038;subd=peekay&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://peekay.org/2009/03/18/iphone-sdk-regular-expressions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0846f908258a0d05752ee89a61da5d4f?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">peekay</media:title>
		</media:content>
	</item>
	</channel>
</rss>
