Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 04-16-2008, 01:51 AM   #6 (permalink)
HiRez
New Member
 
Join Date: Apr 2008
Posts: 1
Default Re: Pulling Data From A Web Page

Quote:
Originally Posted by Cander
Thanks for that. I can't believe how easy that is. I was just about to start having to figure that out. Now my concern is how to pull data from between two sets of known characters instead of splitting based on a single delimeter. So if anyone has any ideas, I am all ears. Nothing jumps out at me in the API to do this easily. I can figure out the harder way, but didn't know if their was something as simple as splitting was for you.

Example:

hey

I would want to get the word 'hey'
You could use the method scanUpToCharactersFromSet:intoString: to find multiple characters, but that won't work for a lot of things, and probably won't work for you here. What you really want is to use regular expressions to do the parsing. AFAIK there is nothing in Coca to handle it, but you could use NSTask to call a command-line function like grep, or Python, Perl, or Ruby script (all of which have built-in support for REs), or use a third-party Cocoa framework.

Pretty odd that Cocoa has no regular expression support directly, a major oversight if you ask me (you'd think it would have been pretty obvious when they were coming up with NSScanner, even back in the NeXT days).
HiRez is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,557
Threads: 89,126
Posts: 380,253
Top Poster: BrianSlick (7,103)
Welcome to our newest member, wTaylorDaviesp
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 04:17 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.