$PageTitle = "task1"; $PageHeading = "Open Round"; include "../files/user.php"; include "authenticate.php"; include "../header.php"; ?>
At this moment, you are not allowed access to the question.
} else { ?>Perl's regular expressions have been adopted by other systems, sometimes incompletely. Version 9.1 of the SAS enterprise database system, for example, didn't implement case mapping codes in replacement text. This task does so, but for any string.
Embedded in a string of printable ASCII characters are the following symbol sequences, that change the state of the characters that follow:
| Code | State change | |
|---|---|---|
| \u | The following single character is converted to upper case | |
| \l | The following single character is converted to lower case | |
| \U | All following characters are converted to upper case | |
| \L | All following characters are converted to lower case | |
| \E | Stop converting case |
Write a program that reads a file of lines representing perl-style case mapping strings, preceded by the number of lines, and displays the converted lines. There can be up to 20 lines and each line can have up to 100 characters.
Input:
3 \Uunsw\E Computing \uprogcomp \l2013\u. T\LITLE CASE\E is also known as \L\uproper CASE\E. |
Output:
UNSW Computing Progcomp 2013. Title case is also known as Proper case. |
9
Mapping "\UuPpEr"\E and "\LlOWeR\E" case
\uNon-\lNested \using\lles
Nested \L\umc\uvEE\E and \Uo'l\le\la\lr\ly\E, \U\lR\Eedundant sequences.
Nested same-case: \Uab\uc\ud\uef\E and \L\lAB\lC\lDE\lF\E
Punctuation is unaffected\U:!@#$%^&*()_-+={}[]'";:,.<>/?1234567890\E
To get a \u\ precede it with either \l\u or \u\l.
\u\E is optional and can be redundant\E\E\E: \u\Uh\u\LeLLo[endofline] produces \Uh\LeLLo
Pointless repeats: \L\L\L\L\L\L\L\L\U\L\L\L\L\U\U\U\L\L\L\LX\E
Non-special sequences \t \n \e \A \$ \\
|
You may submit multiple times. Only your most recent submission for each question will be marked.
} include "../footer.php"; ?>