Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
sav08:playground [2010/09/29 21:54] hossein |
sav08:playground [2012/07/27 12:54] hossein |
||
---|---|---|---|
Line 1: | Line 1: | ||
====== Playground ====== | ====== Playground ====== | ||
+ | |||
Line 19: | Line 20: | ||
d) Show that $\leq_1$ is a linear extension of $\leq$ if and only if $(A,\leq_1)$ is a total order and the identity function is a monotone function from $(A,\leq)$ to $(A,\leq_1)$. | d) Show that $\leq_1$ is a linear extension of $\leq$ if and only if $(A,\leq_1)$ is a total order and the identity function is a monotone function from $(A,\leq)$ to $(A,\leq_1)$. | ||
- | ===== Perl ===== | ||
- | |||
- | * Write a regular expression that matches a pair of <d> and </d> XML tags and the text between them. The text between the tags can include any other tags. | ||
- | * The lexical analyzer typically finds the longest matches. Some languages such as Perl have introduced laziness in matching. By adding a question mark to the end of an operator its lazy version is obtained. For example, given an input 'aaaaa', the expression $a*$ will match the entire input. But the lazy version $a*?$ matches the minimum number of possible characters, which is the empty string. Using lazy repetition find a compact representation for the first part. |