You got it right, except for the negated character class. Because the metacharacter "." is meaningless inside a character class (because "." and [.] would be the same thing) the period means a literal period inside a character class. So the regex is actually:
\. # literal period
( # start capture
[^.] # any character that's not a period
+ # one or more of them
) # stop capture
$ # end of line
This guarantees that you'll get the last chunk of non-periods at the end of URL... but beware because like I said "http://www.yahoo.com" will match "com", and "http://www.somewhere.com/home/" will match "com/home/".
Gary Blackburn
Trained Killer |