I often face a problem : I have an URL, and I would like to get the list pointed by this URL. So I wanted a function that could return me this ID whenever I was passing an URL to it!
Some Regexp, some recursivity and here we are :
The function basically return null if the URL passed is not a list URL, and return the list ID whenever you pass an URL to it. It also works when you pass the url containing some allitems.aspx after the name of the list...
Hope it helps