I have an application that shows photos and albums to a user. Based on current state of the application I show appropriate view. Everytime view changes I change the url, controller then gets the url value using window.location.hash
It returns the string of this form:
"photos/byalbum/albumid"
"photos/allphotos"
"photos/eachphoto/albumid/photoid"
My question is how do I parse this using javscript regular expressions to determine which view I should be showing and also to get the parameters (albumId/photoId)
I think you are better off doing this, then regex:
Then you get array that you can examine.
Rather than using regex, you should probably simply split the string on "/" and examine each piece of the value for the data that you need.
Then play with your data as you wish. :)