views:

125

answers:

1

I am looking for a regex (or other method) that can check and parse app store links. I have an app that can take record these links but I want to check that the format is correct before I accept it.

e.g.

http://itunes.apple.com/gb/app/instapaper/id288545208?mt=8

http://itunes.apple.com/us/app/iq-test-sale/id297141027?mt=8&uo=6

http://itunes.apple.com/gb/app/speedtest-net-speed-test/id300704847?mt=8

Has anyone done anything like this?

+1  A: 

Instead of using a regular expression you can also use NSURL to parse these. Simply create an NSURL and then you can use it's functions to access all the different bits like the hostname, path and query parameters.

With some simple logic you can then recognize all the different possible appstore links.

St3fan