- Last edited August 19, 1999 |
$LinkPattern? = '([A-Z?]+(\-|[a-z0-9]+))([A-Z0?-9][a-z0-9]*)+';This pattern is much more forgiving allowing words with hyphens, trailing capitals etc. As I had problems using the \b word boundary expression I had to introduce some code to prevent words forming that didn't begin on valid boundaries --TimM
We tend to use the hyphen as a sort of namespace.
The following are hyperlink tests:
Should be recognized (verify the ? links to the full text)
NormalLink? NormalLongerLink?Grey areas that give a link but possibly shouldn't?:
JServeProduct? TogetherJ? OT99? OT2000? OT99Conference?
ABCtestOf? IBMCorporationLtd?
E-Commerce? IBM-Product? IBM-ProductName?
PPRelease1? - follow it and check the title and search results PPReleaseFourA? - follow it and check the title and search results
T-1? Phase1? IBM-Product?-Name Y2K? (actually I quite like that this is a link, as would be a product like B2B?) Postcode: EC1A? 4AA X509?Should not be recognized:
malformedMixedWord malformedMixedword singleword Atest ABtest ABCtest C++ IBM Microsoft OT1 T1 Tim.Mackinnon Tim.MackinonAndrew Test-ProductShould not break:
Links to other sites[1]
- Last edited August 19, 1999 |