Link Pattern |
|
|
We consider two or more capitalized words run together
to be a potential hyperlink. For this purpose a word
must be all alphabetic and have at least one lower-case
letter.
$linkWord = "[A-Z][a-z]+";Some people might find this overly restrictive, especially people named O'Connor. The rule does require ingenuity at times, but, it is at least easy to articulate and remember. Can I suggest replacing the pattern with "[A-ZÀ-Ý][a-zþ-ÿ]+" to handle european languages? I might also work on a french version of the code if anybody else shows interest. MarcAntoineParent. Diacritical support added. --DaveSmith Extending the link pattern to allow for optional trailing number is trivially easy, and allows links like MoreDiscussion1, MoreDiscussion2, etc. It also allows for links like DayNotes19991210, which opens up possibilities for having calendar pages with DateStamps. $LinkPattern = "($linkWord){2,}(\d*)"; Has there been any abuse or crashes caused by placing no limit on the number of words in the LinkPattern? Perhaps
|
Last edited January 22, 2002 Return to WelcomeVisitors |