On 3/21/2011 1:07 PM, Terry Carmen wrote: > I'm trying to match any URL that points to a URL shortener. > > They typically consist of http(s) followed by a domain name, a slash > and a small series of alphanumeric characters, *without a trailing "/" > or file extension*. > > I seem to be having pretty good luck matching the URL, however I can't > figure out how to make the regex explicity *not* match anything that > ends in a slash or contains an extension. > > For example, I want to match "http://asdf.ghi/j2kj4l23", but not > "http://asdf.ghi/j2kj4l23/abc.html" or "http://asdf.ghi/j2kj4l23/" > > I tried using the perl negative look-ahead as both : (?!/) and (?!\/) > without success. > > Can anybody toss me a clue?
Show us your current rule and we can tell you what you are doing wrong. -- Bowie