At this moment, you are not allowed access to the question.

Task 1. Case Mapping

Available Marks: 7

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

Rules

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.

Example

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.

Test Data

You should test your program on the following data:
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 \$ \\

Step 0

Refresh the browser window if the page has been idle for some time.

Step 1

Cut and paste the output of your program for the test case into the box below:

Step 2

Paste the source code for your program into the box below:

Step 3

When you are sure all the data has been entered correctly on the form press the submit button below.

You may submit multiple times. Only your most recent submission for each question will be marked.