Home Accessibility Courses Twitter The Mouth Facebook Resources Site Map About Us Contact
 
For 2023 (and 2024 ...) - we are now fully retired from IT training.
We have made many, many friends over 25 years of teaching about Python, Tcl, Perl, PHP, Lua, Java, C and C++ - and MySQL, Linux and Solaris/SunOS too. Our training notes are now very much out of date, but due to upward compatability most of our examples remain operational and even relevant ad you are welcome to make us if them "as seen" and at your own risk.

Lisa and I (Graham) now live in what was our training centre in Melksham - happy to meet with former delegates here - but do check ahead before coming round. We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active!

I am also active in many other area and still look after a lot of web sites - you can find an index ((here))
Matching disparate referencing systems (MediaWiki, PHP, also Tcl)

Yes, we are Well House CONSULTANTS and do a bit of specialist coding ...

I have a requirement on my plate at present to write a piece of code for a customer that recognises cross reference codes within a document and turns them into links. And what makes the task quite difficult is that the references come from all sorts of different original sources, with varied formats some of which might even be identifiable in two ways.

We'll be using a regular expression based identification system, but how to make such a scheme logical, easy to follow, and easy to maintain in the future as new references and exceptions to the general rules get added? Well to start with, I'll be using the bunching technique I described last week to make individual regular expression easier to read, and to avoid the need to keep repeating subsection bundles of special characters. But there will be more to it ...

Spring, Summer, Autumn

Most of the cross reference codes will conform to a pattern, or a series of patterns, which can be identified fairly easily. I'll describe these as "summer" expressions, as that's the time of year that most people go on holiday, that places are crowded, and there's a maximum of facilities available for them.

For those who don't manage to catch the summer, there are autumn holidays - fewer people around, and special cases for those who have missed out on the summer; I'm going to describe a series of autumn matches for those references which have been missed by the main filters

Some of the URLs that form special references include an embedded main (summer) reference in them ... so that handling of them can't wait until the Autumn. So for this reason, we'll also provide early-bird spring holidays (or regular expressions) to ensure that it's the proper complete reference that's handled, rather than the embedded mainstream one.

And finally ... I understand there are special cases. We'll call those "snowdrops" - we'll allow them to be individually marked up within documents by the document provider, and they'll be extracted / handled ahead of spring.

A new idea? No - there's nothing much new in this world ... you'll see a similar concept used within expect, with the expect, expect_before and expect_after commands. "Look out for xxx, failing that yyy, failing that zzz". Tcl may be mature but it's still an inspiration!
(written 2009-05-19)

 
Associated topics are indexed as below, or enter http://melksh.am/nnnn for individual articles
Q110 - Object Orientation and General technical topics - Programming Algorithms
  [202] Searching for numbers - (2005-02-04)
  [227] Bellringing and Programming and Objects and Perl - (2005-02-25)
  [642] How similar are two words - (2006-03-11)
  [1157] Speed Networking - a great evening and how we arranged it - (2007-04-21)
  [1187] Updating a page strictly every minute (PHP, Perl) - (2007-05-14)
  [1391] Ordnance Survey Grid Reference to Latitude / Longitude - (2007-10-14)
  [1840] Validating Credit Card Numbers - (2008-10-14)
  [1949] Nuclear Physics comes to our web site - (2008-12-17)
  [2259] Grouping rows for a summary report - MySQL and PHP - (2009-06-27)
  [2509] A life lesson from the accuracy of numbers in Excel and Lua - (2009-11-21)
  [2586] And and Or illustrated by locks - (2010-01-17)
  [2617] Comparing floating point numbers - a word of caution and a solution - (2010-02-01)
  [2894] Sorting people by their names - (2010-07-29)
  [2951] Lots of way of converting 3 letter month abbreviations to numbers - (2010-09-10)
  [2993] Arrays v Lists - what is the difference, why use one or the other - (2010-10-10)
  [3042] Least Common Ancestor - what is it, and a Least Common Ancestor algorithm implemented in Perl - (2010-11-11)
  [3072] Finding elements common to many lists / arrays - (2010-11-26)
  [3093] How many toilet rolls - hotel inventory and useage - (2010-12-18)
  [3102] AND and OR operators - what is the difference between logical and bitwise varieties? - (2010-12-24)
  [3451] Why would you want to use a Perl hash? - (2011-09-20)
  [3620] Finding the total, average, minimum and maximum in a program - (2012-02-22)
  [3662] Finding all the unique lines in a file, using Python or Perl - (2012-03-20)
  [4325] Learning to program - what are algorithms and design patterns? - (2014-11-22)
  [4401] Selecting RECENT and POPULAR news and trends for your web site users - (2015-01-19)
  [4402] Finding sum, minimum, maximum and average in Python (and Ruby) - (2015-01-19)
  [4410] A good example of recursion - a real use in Python - (2015-02-01)
  [4652] Testing new algorithms in PHP - (2016-02-20)
  [4656] Identifying the first and last records in a sequence - (2016-02-26)
  [4707] Some gems from an introduction to Python - (2016-10-29)


Back to
Camera to record where a picture was taken
Previous and next
or
Horse's mouth home
Forward to
How you are (re)presented at an exhibition
Some other Articles
Excellent product, excruciating customer service. 3 Mobile Broadband
Copy writing - allowing for the cut
RT @brento - a valuable source for the twitter newbie
How you are (re)presented at an exhibition
Matching disparate referencing systems (MediaWiki, PHP, also Tcl)
Camera to record where a picture was taken
Are we IITT (Institute of IT Training) members?
An FAQ on the Apache httpd and Apache Tomcat web servers, and on using them together
Abstract Classes - Java
Choosing the right version of Java and Tomcat
4759 posts, page by page
Link to page ... 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96 at 50 posts per page


This is a page archived from The Horse's Mouth at http://www.wellho.net/horse/ - the diary and writings of Graham Ellis. Every attempt was made to provide current information at the time the page was written, but things do move forward in our business - new software releases, price changes, new techniques. Please check back via our main site for current courses, prices, versions, etc - any mention of a price in "The Horse's Mouth" cannot be taken as an offer to supply at that price.

Link to Ezine home page (for reading).
Link to Blogging home page (to add comments).

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2024: 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho

PAGE: http://www.wellho.net/mouth/2189_Mat ... -Tcl-.html • PAGE BUILT: Sun Oct 11 16:07:41 2020 • BUILD SYSTEM: JelliaJamb