The metacharacters ?, *, +, and c/ doesn't match Within the page after the URL, even if the URL contains nasty text.īeware - I really should have tested this before posting, but I'm leaving that for Also copes with tags with GET method data and links Will cope with multiple URLs on one line, and with tags that have otherĪttributes after the HREF. Quoted or unquoted URLs, and pages with nasty names like the html.htm I keep Still not level 3 - won't cope with other protocols such as links to FTP, won't cope withĪ tags with other attributes if they come before the HREF, etc. Here's my "first cut" at an alternative and more rigerous solution to yourĬode: s/(?#]+)\.html?(|$)/$1.jsp$2/gi excepting "level 2" issues such as files called html.html PerhapsĪll the original HTML was generated by DreamWeaver or something similar? If so, the The references are quoted (I know that's how you're supposed to write HTML). I should point out that is pointless as it means "exactly one of theĮlement in front" and that's the default anyhow. Significant, which might be the case in jfp's data stream, but not in the generalĬase. The means "notĪn h, a t, a p or a colon" and I don't think that's at all what was intended, and theįormat is very tightly ties to the data - where and how many spaces there are is very The first solution posted looks distinctly level 1 to me. (you caught me in expansive mood this morning!). It was achievable either in THAT address data set I described.Ĭoming back to the question. If you're doing character or voice recognition, or translations. I don't think you'll ever fully achieve level 3 when matching a spoken language, or There's a chance of your users finding something really nasty they can enter - a.k.a. You shouldĪim to achieve this level if you're using it on a public facing web server otherwise, Necessary, even if the computer purists will point you in its direction. Level 3 coding can require some considerable investment in writing and isn't always ![]() ![]() My "Wiltshire" example would work, a file that someone has called "html.html" wouldīe correctly changed to "html.jsp" in jfp's example, etc. Level 3 - Robust code that is written accoring to the specification of the input. My example, someone with the surname "Wiltshire" specified without a "Mr" or initial) It may not beĪ correct solution for everyone / according to the full specification of the input,īut it does work for all the data that's thrown at it. Level 2 - Code designed for use by its author on multiple data sets. (Southampton) postcodes - especially in cases where the original data was S-zero. I remember one county of "Isle of Skye" and confusion between S (Sheffield) and SO Certainly level 1 code, and indeed I had to manually adjust a few results Pages that had been set up by hand and names, postcode, counties etc were "all over A couple of years ago, I had to extract 800 addresses from HTML web Not be a correct solution for all possible data sets, but it works in the needed Level 1 - Code that is required to work on a single instance of a data set. There are three "levels" of coding (IMHO). If it does what you need, that's great - Perl is a PRACTICAL language after all,Įven if you appear to be putting the competion (Java) into all your web pages Though looking at it now I dont think I need to group the href|HREF as I've used the i switch. Posted by admin (Graham Ellis), 27 November 2002 Quote: After googling and adapting bits this seems to work If you proceed, we will take that as your consent to accept cookies.This site uses cookies - see for details.I am also active in many other area and still look after a lot of web sites - you can find an index ((here)) We are far from inactive - rather, enjoying the times that we are retired but still healthy enough in mind and body to be active! 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. 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. ![]() 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. For 2023 - we are now fully retired from IT training.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |