Thursday, March 9, 2006

regular expressions in Cocoa


I don't get why program languages don't include regular expression support, either built in or as one of the included libraries.


I wanted to parse some html in Objective-C to find the url for an image.  Ideally, I want to use this expression to find an image url:

img src=\"([^\"]+)\"



Objective-C and Apple's libraries do not include any regular expression support.  I found the OgreKit framework that adds this support. 


Unfortunately, all of the documentation is in Japanese.  And, I wasn't able to correctly embed this framework in my project.  I just ended up searching for the url manually.


Technorati Tags: , , , ,

1 comment:

  1. Hi Paul,
    Thank you for using OgreKit :-)
    Sorry, I'm not good at English...
    If you would like to embed the framework to your application, please see the section "Application Setting" in the following tutorial.
    http://cocoadevcentral.com/articles/000042.php
    Cheers,
    isao.

    ReplyDelete

Seamless Local Control: Integrating WeatherFlow with Home Assistant Across VLANs

I've been pleased with my Home Assistant setup for some time now. One of my main focuses has been achieving local control. This ensures...