added a pretty complicated two lines to the daily quote script to clean up just about any typo in the verse part that I can think of. It can clean up something like sf%@#$^BB5f,,_–––_,(7),9j and will output 5–7,9 for the verse location. The previous version could handle most of the above, but not multiple commas.
kk, the script will delete the first character till it gets to a digit. It will do the same starting at the end of the line. Another command will get rid of anything that is not a number or comma or dash. Then if there is more than two characters occuring together that is not a number (which at this point can only possibly be dashes or a commas) it will play it safe and convert it to a single dash. This means that 4,,5 will be converted to 4–5. 4,5 will remain the same. 4–5 will 4–5 remain the same. 4––5 will become 4–5 and 4,5 will become 4–5.
Problems still remain like the script needs to check that the numbers are always increasingly larger and the number should not be larger than the chapter in the Bible with the largest number of verses (Psalm 119:176). Still, it is a nice script and demonstrates the use of a more advanced PCRE capability. In other words my PCRE understanding is growing nicely.
Soon I will get back to work on CSS so I can clean up a few layout problems on this site that are cropping up in IE7. I expect there will be a fair amount of work required for this.TAGS: none
All Memo Tagsanime
21, hard to remember
1, memo blog
1, reformat hard drive
1, site update
5, site version
205, star wars