http://qs321.pair.com?node_id=967486


in reply to Extracting Page Name

The something simple may be that the 'pagename' will follow the last slash.

The catch: it may be followed by many options -- a colon, Note_1 if it's followed by a port number; a questionmark for several possible uses; and perhaps others that I'm blanking on just now. But regardless, the entity from the last slash, through a period to the next punctuation should be what you're looking for.

And to broaden the hint a bit further, the regex documentation and tutorials here will show you precisely the way to obtain what you're looking for.

Update: Note_1 See correction (+ + by quester immediately below. Aargh.