Tutoring web programming, you might encounter a question about Perl. The tutor mentions an observation. Because inline styles use quotes, and then of course printing a string often uses quotes around it, a situation can easily develop in which nested …

Perl programming: printing a string Read more »

Tagged with: , , ,

The tutor tells the workings of yesterday’s pattern matching example. In yesterday’s post I mention that the regular expression if ($input=~/item1[^0-9]*[0-9]*.?[0-9]{0,2}/i) can find the pattern item1….$#####.## in a longer string. Here are some explanatory points: =~ is the pattern find …

Perl: regular expressions: yesterday’s code explained Read more »

Tagged with: , , ,

The tutor demonstrates a Perl regular expression that finds an item name and its price in a string. Suppose you believe that the price of item1 is given in a string, but aren’t sure how exactly it’s said. It could, …

Perl: using regex (aka regular expression, pattern matching) to find an item and its price in a string Read more »

Tagged with: , , ,