text:
Special String reformatting
This challenge is to take an alphabetical string as input and to apply the following conversion:
The first of each type of character of the string must stay, and must be immediately followed by an integer representing how many of these characters were in the original string. Any repeating characters must be omitted.
All inputs will be entirely lower-case letters (no spaces). Outputs must be ordered in the same way as the inputs (input hi must give output of h1i1, not i1h1)
Examples
Input: potato Output: p1o2t2a1
Input: pqwertyuiop Output: p2q1w1e1r1t1y1u1i1o1
Input: thisisanexample Output: t1h1i2s2a2n1e2x1m1p1l1
Input: oreganoesque Output: o2r1e3g1a1n1s1q1u1
Input: aaaaaaabaaaaaa Output: a13b1
Scoring
This is code-golf. Shortest answer wins!

Since the input cannot have spaces, can we separate the letters and the digits with spaces?

@Adám I'm going to say no just so the output format stays consistent and unchangeable

Could we output in pairs (i.e. ["p1","o2","t2","a1"] instead of p1o2t2a1)?

@KevinCruijssen I'm going to say no so that the output stays consistent for all answers, but feel free to add it as an aside to your answer because now I'm curious as to how much shorter this could make your code

Lowercase letters, or lower case ASCII? Your example only contains ASCII.

@Abigail lower case ASCII, if that's what my example uses. Sorry, I didn't realise there was a difference

Suggested test case: abaaacaaaaaaa (more than 9 of the same letter).

@Zgarb good idea, I edited it into the question

@Sqepia There are 26 lowercase ASCII letters, but there are over 2000 lower case letters in Unicode. perl -E 'for (1 .. 0x10FFFF) {$c ++ if chr ($_) =~ /\p{Lower}/} say $c' for a quick count (it's a bit of a moving target, as each revision of the Unicode standard may introduce more lower case characters).

Possible duplicate of Shorten text with Run Length Encoding

@pppery I guess this is similar, but this question doesn't allow for duplicate characters at all. This question was really a test to see how fast challenges would be solved - my next challenge (in a few days) will be more creative and harder to solve

Easy challenges get answered quickly. Hard challenges ... not so much

@pppery I figured. This is my first challenge I've posted here after years of lurking (so I wanted to make something relatively simple to see how many answers I would get), I'm gonna try to make some really good challenges soon

@pppery I don't think it's a duplicate, although it's close. That challenge asks to read all lines and to output the run-length encoding, whereas this one has a single input and outputs the uniquified run-length encoding (i.e. test would result in t1e1s1t1 in that other challenge, but t2e1s1 here). They're definitely closely related, but not a dupe imo.

APL (Dyalog Unicode), 7 bytes (SBCS)
Anonymous tacit prefix function.
,,∘⍕∘≢⌸

Try it online!
⌸ apply the following function between each unique character and the indices where it occurs:
 , concatenate the character
  ∘ to
   ⍕ the stringification
    ∘ of
     ≢ the indices' count
, flatten

Python 3, 58 \$\cdots\$ 50 57 bytes
Added 3 bytes and switched to Python 3 to fix bugs.
Added 7 bytes to make output a string.
lambda s:''.join(c+f'{s.count(c)}'for c in{}.fromkeys(s))

Try it online!
Outputs a string.
Outputting a list of strings is 50 bytes.

Using a dict is a really nice idea! It can be 2 bytes shorter with dict(zip(s,s)).

@ovs Thanks! Just saved 3 bytes using {} instead of dict :-)

PHP, 63 bytes
foreach(array_count_values(str_split($argn))as$a=>$b)echo$a.$b;

Try it online!
Built-ins and a whole lot of glue.  Input via STDIN, output to STDOUT.

too bad count_chars doesn't return an array ordered as the string

A more interesting version is array_walk(array_count_values(str_split($argn)),fn($a,$b)=>print($b.$a));. Sadly, it's 72 bytes long... :(

@IsmaelMiguel why would it be more interesting? it's basically the same with a callback overhead, longer, less performant.. just my opinion ;) A little advice, print doesn't need brackets: array_walk(array_count_values(str_split($argn)),fn($a,$b)=>print$b.$a); would do

@IsmaelMiguel I like the functional concept of that approach and it's too bad you can't do some variant like array_walk(array_count_values(str_split($argn)),print); (55 bytes) but that won't work sadly.

@Kaddath Yes, a plain boring old loop sure is more interesting than implementing new concepts added in the latest versions of PHP .... (Yes, it's faster, but ...)

@640KB That would be amazing. Oh, something to try is the removed split function, which I couldn't get to work, but may save some bytes... Or none...

Well, the closest I got is array_walk(array_count_values(str_split($argn)),'printf'); but it doesn't print out the 2nd parameter... :(

Wolfram Language (Mathematica), 34 bytes
This is the dreaded obvious chain-the-built-ins. Print can accept multiple arguments and will print them without any separators.
Print@@Flatten@Tally@Characters@#&

More scary version, for the same number of bytes:
Print@@(##&)@@@Tally@Characters@#&

I suspect that a better hack consisting entirely of the characters #&/() can be used to get rid of Flatten, but I couldn't come up with one.
Of course, Mathematica has both LetterCounts and CharacterCounts, and there's also Counts instead of Tally, but all of these seem to return association objects that seem excessively complicated to work with.
Try it online!

Association objects can be converted to lists of Rules using Normal, but the Rule objects end up taking more bytes to work with.

J, 15 17 bytes
Thanks to Jonah for finding and fixing a bug!
[:;~.<@,&":"0#/.~

Try it online!

~.,@,.":@#/.~ is equivalent for 13 bytes, but both yours and the 13 byte version fail the final test case.  This rather verbose 19 byte version passes all test cases.

17 bytes passing all test cases

@Jonah Thanks! I think the last test case was added later and I didn't revisit my J solution.

Python 3, 49 bytes
lambda s:''.join({c+str(s.count(c)):1for c in s})

Try it online!
Outputs a string.
Based on Noodle9's solution, which uses a nice idea of a dictionary to deduplicate while preserving order, which they do in Python 3 but not Python 2. Note that set doesn't preserve order.
The idea is to make the character-with-count strings be keys of a dictionary so that only the first instance is used. The values in the dictionary don't matter, since dictionaries iterate over keys by default.
I had thought at first that the deduplication must be applied to the characters of the input string, but realized that it also works on the strings to be joined in the output, since a given character is always attached to the same count.
Outputting a list of strings without joining takes 43 bytes.

K (oK), 23 18  bytes
{,/t,'$+/x=\:t:?x}

Try it online!

,/(!g),'$.g:#:'= for 16 bytes

@streetster In which verson of K? I can't make it work in oK in TIO

oK - https://tio.run/##y9bNz/7/X0dfQzFdU0ddRS/dStlK3VapoLA8taiksjQzv0Dp/38A

@streetster Oh, I was trying to run it in a list of strings (as in my solution)

Ah, then yours is shorter if we need to define as a function :)

Managed a 17 byte (function) with K4, f:{,/(?x),'.$#:'=x} but it works because the $ is applied to the value of the dictionary, not the whole thing.

@streetster I always define my answers as functions. Anyway, thank you for your solutions - I need to lear how to work with dictionaries.

05AB1E, 6 bytes
Ùε¢yì?

Try it online or verify all test cases.
Explanation:
Ù       # Uniquify the (implicit) input-string
 ε      # For-each over each character in this string:
  ¢     #  Count the amount of times the current character occurs in the (implicit) input
   yì   #  Prepend the current character before this count
     ?  #  Print it without newline

Jelly, 5 bytes
Lƙż@Q

A full program printing the result (or a monadic Link yielding a list of pairs of characters and integers).
Try it online!
There are loads of ways to achieve this in 6 bytes (e.g. Qżċ@€¥).
How?
Lƙż@Q - Main Link: list of characters, S          e.g. "cabbage"
 ƙ    - for groups of identical elements (of S):       (c aa bb g e)
L     -   length                                       [1,2,2,1,1]
    Q - de-duplicate S                                 "cabge"
   @  - with swapped arguments:
  ż   -   zip                                          [['c',1],['a',2],['b',2],['g',1],['e',1]]
      - implicit, smashing, print                      c1a2b2g1e1

Python 3, 62 bytes
f=lambda s:s and s[0]+str(s.count(s[0]))+f(s.replace(s[0],''))

Try it online!

JavaScript (ES6), 55 bytes
s=>[...new Set(s)].map(c=>c+~-s.split(c).length).join``

Try it online!
Commented
s =>                    // s = input string
  [...new Set(s)]       // create a set from the input string and split it,
                        // resulting in an array of characters arranged in
                        // order of first appearance
  .map(c =>             // for each character c in this array:
    c +                 //   append c
    ~-s.split(c).length //   followed by the number of occurrences in the
                        //   original string
  )                     // end of map()
  .join``               // join everything

perl -p, 52 50 bytes
s/./$&1/g;1while s/(\D)\K(\d+)(.*)\1\d/($2+1).$3/e

Try it online!
Starts off by adding 1 to each character. Then, as often as possible, find a letter followed by a number, with the same letter elsewhere in the string followed by a digit (which has to be 1). Increment the count, and remove the same letters followed by its 1.
Initial solution, following a very different technique:
perl -nF//, 52 bytes
$F{$_}++for@F;$F{$_}&&print$_,$F{$_}xor$F{$_}=0for@F

Try it online!
Reads a line from STDIN, assuming it's not newline terminated.
Splits the input into characters, available (in order), in @F (due to the -F//). Counts the occurrence of each character in the hash %F. Then loops over @F: if present in %F with a true value, print the character and its count, then set the corresponding entry in %F to 0. This ensures each character is only outputted once.
The TIO code has some header and footer code so we can handle multiple test inputs. They're not needed if we just have one line of input.

C (gcc), 105 \$\cdots\$93 90 bytes
Saved 2 5 bytes from the man himself Arnauld!!!
d;c;f(char*s){for(;d=1,c=*s;c-1&&printf("%c%d",c,d))for(char*q=s++;*++q;d+=*q==c?*q=1:0);}

Try it online!

93 bytes

@Arnauld Diabolical, was trying to align j and d and clean up the string access with no joy - thanks! :D

Using a 2nd pointer is actually shorter: 90 bytes

@Arnauld Interesting, the thought crossed my mind but dismissed it right away - thanks! :-)

K4 17 16 bytes
Solution:
{,/(?x),'$#:'=x}

Examples:
q)k){,/(?x),'$#:'=x}"potato"
"p1o2t2a1"
q)k){,/(?x),'$#:'=x}"pqwertyuiop"
"p2q1w1e1r1t1y1u1i1o1"
q)k){,/(?x),'$#:'=x}"thisisanexample"
"t1h1i2s2a2n1e2x1m1p1l1"
q)k){,/(?x),'$#:'=x}"oreganoesque"
"o2r1e3g1a1n1s1q1u1"
q)k){,/(?x),'$#:'=x}"aaaaaaabaaaaaa"
"a13b1"

Explanation:
{,/(?x),'$#:'=x} / the solution
{              } / lambda function taking implicit 'x' argument
             =x  / group x (dict of unique chars => indices)
          #:'    / count length of each group
         $       / cast to string
       ,'        / join each-both
   (  )          / do this together
    ?x           / distinct x
 ,/              / flatten

Brachylog, 5 bytes
ọ∋∋w⊥

Try it online!
Full program, or alternatively a predicate which prints the output then fails. Could be one byte shorter if it could generate the characters as a mix of strings and integers, but that seems like a bit too far out there of an output format.
   w     Print (without a newline)
  ∋      an element of
 ∋       an element of
ọ        a list of pairs [element, # of occurrences] in order of first appearance,
    ⊥    then try it again some other way.

AWK + -F '', 65 + 4 = 69 bytes
{while(i++<NF)if(!a[$i]++)b[i]=$i;while(j++<i)printf b[j]a[b[j]]}

Try it at awk.js.org
A shorter 64 59+4 byte program, which runs on GNU awk with -F '', is this:
{while(i++<NF)if(!a[$i]++)b[i]=1;for(i in b)printf$i a[$i]}

Annoyingly, though, while 'Try it online' links to the GNU awk manual page, it doesn't seem to use GNU awk, and refuses the -F '' command-line option.
The alternative link above (to awk .js.org) accepts the command-line option, but then outputs in a different order, which costs a frustrating additional one six bytes  to correct (which I have included above as the price of verifiability).

we don't count flags as part of byte count any longer; instead, the flags used count as part of a separate language as opposed to just AWK.

CJam, 12 bytes
Port of the Pyth answer.
q:A_&{_Ae=}%

Try it online!
Explanation
q            Take the whole input
 :A          Assign to a variable
   _&        Set union w/ itself
     {    }% Map:
      _          Join the uniquified character
       Ae=       With the count of the character in the input string.

CJam, 16 bytes
CJam has the built-in, so I guess it simplifies the question. Unfortunately the built-in does it in the wrong order...
q:A{A#}$e`{-1%}%

Try it online!

Perl 5 -p, 28 bytes
s|.|($b=s/$&//g)?$&.$b:''|ge

Try it online!

Nice one! Nested s/// feels like it shouldn't work!

@DomHastings  I don't disagree.  However, if it's stupid but works... :)

Ruby 2.7 -paF|, 17 bytes
$_=[*$F.tally]*''

Try it online!
This is more or less built in to the recent Ruby release as the tally method.

R, 72 71 bytes
cat(rbind(z<-unique(y<-el(strsplit(scan(,""),""))),table(y)[z]),sep="")

Try it online!

JavaScript (V8), 106 102 bytes
e=>{for(o="",i=0;i<e.length;i++)o.includes(e[i])||(o+=e[i]+e.match(RegExp(e[i],"g")).length);return o}

Try it online!

Gaia, 9 bytes
u$:@$C¦Z$

Try it online!
There's a bug or a mis-description of ₔ in the documentation:

Push an extra copy of the arguments in swapped order, then run the operator. This only alters the behaviour of dyads.

While the description for ₌ reads:

Push an extra copy of the arguments before executing the operator.

Unfortunately, ₔ only swaps the order of the arguments rather than pushing a swapped copy, otherwise $:uC¦ₔZ$ would be 8 bytes.

T-SQL, 111 bytes
Added a line change to make it readable
WHILE @+@ like'_[a-z]%'
SELECT @=concat(s,left(@,1),len(@)-len(s))FROM(SELECT
replace(@,left(@,1),'')s)s
PRINT @

Try it online

I'm one to talk posting golfed C, but, how's that readable? T_T

@Noodle9 reading sql isn't that hard. The commands are simple and have nice long descriptive names - ill suited for golfing. But what I mean by readable, is that you don't have to scroll in order to see the whole text.

SNOBOL4 (CSNOBOL4), 96 bytes
	I =INPUT
N	I LEN(1) . X	:F(O)
	N =
S	I X =	:F(B)
	N =N + 1	:(S)
B	O =O X N	:(N)
O	OUTPUT =O
END

Try it online!
	I =INPUT		;* Read input, set to I
N	I LEN(1) . X	:F(O)	;* Get the first character of I as X; if I is empty then goto O
	N =			;* set N to empty string (evaled as 0 in arithmetic)
S	I X =	:F(B)		;* remove the first occurrence of X from I. If none exist, goto B
	N =N + 1	:(S)	;* increment N and goto S
B	O =O X N	:(N)	;* Add to the output string and goto N to get the Next character
O	OUTPUT =O		;* print the result
END

Pyth, 8 7 bytes
-1 byte thanks to @isaacg
s+R/Qd{

Try it online!
s+R/Qd{
      {  Deduplicate: keep the first occurrence of each unique character
  R      For each of these unique characters:
 +        - append the character
   /Qd    - to its count in the original input
s        Join the resulting strings

m+d is equivalent to +R

@isaacg Thanks! I didn't realize that R and d could be used together

Stax, 7 bytes
ô!Ω;òá☺

Run and debug it

SimpleTemplate, 54 47 bytes
This was a very easy, but incredibly fun challenge!
The code simply loops through every character and counts how many times it shows, and presents it all again.
Nothing fancy at all...
{@eachargv.0}{@incR.[_]}{@/}{@eachR}{@echo__,_}

Hey, I didn't say the code was readable!

Here's an ungolfed and readable version:
{@each argv.0 as char}
    {@inc by 1 result.[char]}
{@/}
{@each result as times key char}
    {@echo char, times}
{@/}

Should be easy to understand ...
{@inc} increments the value or creates a new one, if it doesn't exist. (this keeps key ordering).

You can try this on http://sandbox.onlinephpfunctions.com/code/a180782e659c29674fbb0d77dc82d90d238c6e08
Older version: http://sandbox.onlinephpfunctions.com/code/6ee5077eaf38ec445d84086cc07966026ca7c565
(There, you have an example on how to use this in a function, with multiple tests.)

Retina 0.8.2, 31 bytes
+`(.)(.+)\1
$1$1$2
(.)\1*
$1$.&

Try it online! Link includes test cases, unusually without even needing a header. Explanation:
+`(.)(.+)\1
$1$1$2

Collect all repeated characters into a single run at the first appearance.
(.)\1*
$1$.&

Replace each run with its first character and its length.

Charcoal, 14 bytes
⭆Φθ¬№…θκι⁺ι№θι

Try it online! Link is to verbose version of code. Explanation:
  θ             Input string
 Φ              Filter over characters
    №           Count of
        ι       Current character in
      θ         Input string
     …          Truncated to length
       κ        Current index
   ¬            Is zero
⭆               Map over unique characters and join
          ι     Current character
         ⁺      Concatenated with
           №    Count of
             ι  Current character in
            θ   Input string
                Implicitly print

Kotlin, 69 67 bytes
fun String.f()=groupBy{it}.map{(a,b)->"$a"+b.size"}.joinToString("")

Try it online!

C# (Visual C# Interactive Compiler), 57 bytes
s=>s.GroupBy(c=>c).Aggregate("",(r,g)=>r+g.Key+g.Count())

Try it online!

Husk, 8 bytes
ṁS:os#¹u

Try it online!
Husk, 9 bytes
ṁ§:←osLk=

Try it online!

Thunno 2 J, 1 byte
ƈ

Try it online!
LOL! Let me explain...
The ƈ built-in gets the count of each unique element in a list or string:

For "potato" it gives [["p",1], ["o",2], ["t",2], ["a",1]]
For "aaaaaaabaaaaaa" it gives [["a",13], ["b",1]]

Now this happens to be almost exactly what we need. The only thing left is just to join everything into a string, which is what the J flag does.

Arturo, 24 bytes
$=>[tally&|map=>as|join]

Try it!
$=>[           ; a function where input is assigned to &
    tally&     ; create dictionary of occurrences in input
    |          ; then
    map=>as    ; convert to a block
    |          ; then
    join       ; join to a string
]              ; end function

Perl 5 + -pF -MList::Util+uniq, 29 bytes
for$s(uniq@F){$\.=$s.s/$s//g}

Try it online!

This seems to put a 1 before every test case output except the first one

@Sqepia ah yeah, I meant to remove the other inputs, it's only one at a time. Sorry about that! It was counting the newlines...

makes sense, it works as intended then!

Put a pop @F if $F [-1] =~ /\n/ in the Header section of TIO. That will strip off any unwanted newlines.

@Abigail hah, of course, thanks!

Shaved off a byte, getting rid of the loop and the module: https://codegolf.stackexchange.com/a/205936/72767

Japt -P, 10 8 bytes
Would be 7 in Japt v2 but for a bug that costs 2 bytes to workaround.
¬â Ë+UèD

Try it

Arn, 9 bytes
yŽ▬ö░Ú^`"

Try it!
Explained
Unpacked: |{:{|#}\:@
     _         Variable initialized to STDIN; implied
  :@           Grouped by frequency
|{      }\     Folded with concatenation after mapping (key of _)
     :{        First entry
   |           Concatenated with
     #         Length


text:
DON'T... do NOT lowercase UPPERCASE this!
Write a program that outputs its input unchanged. However:

If all uppercase characters are removed from the program, it lowercases all uppercase letters.
If all lowercase characters are removed from the program, it uppercases all lowercase letters.

Transforming characters beyond the basic Latin [A-Za-z] range is optional, but any character with both uppercase and lowercase counterparts within Unicode (Ñ/ñ, Ω/ω, etc.) qualifies for "removal" from your program.
In your answer, please specify the character encoding used along with the language name if it might be ambiguous.
This is code-golf. The less bytes, the better.

Here's an example in a hypothetical programming language, with input "Hello, world!":
DONT_do_NOT_lowercase_UPPERCASE_this(_MY_input_STRING_)

→ Hello, world!
With uppercase characters removed:
_do__lowercase__this(__input__)

→ hello, world!
With lowercase characters removed:
DONT__NOT__UPPERCASE_(_MY__STRING_)

→ HELLO, WORLD!

To be complete, here are the characters/Unicode codepoints that can be removed:
Uppercase Characters
ABCDEFGHIIJKLMNOPQRSTUVWXYZµÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßĀĂĄĆĈĊČĎĐĒĔĖĘĚĜĞĠĢĤĦĨĪĬĮİİĲĴĶĹĻĽĿŁŃŅŇŉŊŌŎŐŒŔŖŘŚŜŞŠŢŤŦŨŪŬŮŰŲŴŶŸŹŻŽſƁƂƄƆƇƉƊƋƎƏƐƑƓƔƖƗƘƜƝƟƠƢƤƦƧƩƬƮƯƱƲƳƵƷƸƼǄǅǇǈǊǋǍǏǑǓǕǗǙǛǞǠǢǤǦǨǪǬǮǰǱǲǴǶǷǸǺǼǾȀȂȄȆȈȊȌȎȐȒȔȖȘȚȜȞȠȢȤȦȨȪȬȮȰȲȺȻȽȾɁɃɄɅɆɈɊɌɎͅͰͲͶͿΆΈΉΊΌΎΏΐΑΒΓΔΕΖΗΘΙΚΛΜΝΞΟΠΡΣΤΥΦΧΨΩΪΫΰςϏϐϑϕϖϘϚϜϞϠϢϤϦϨϪϬϮϰϱϴϵϷϹϺϽϾϿЀЁЂЃЄЅІЇЈЉЊЋЌЍЎЏАБВГДЕЖЗИЙКЛМНОПРСТУФХЦЧШЩЪЫЬЭЮЯѠѢѤѦѨѪѬѮѰѲѴѶѸѺѼѾҀҊҌҎҐҒҔҖҘҚҜҞҠҢҤҦҨҪҬҮҰҲҴҶҸҺҼҾӀӁӃӅӇӉӋӍӐӒӔӖӘӚӜӞӠӢӤӦӨӪӬӮӰӲӴӶӸӺӼӾԀԂԄԆԈԊԌԎԐԒԔԖԘԚԜԞԠԢԤԦԨԪԬԮԱԲԳԴԵԶԷԸԹԺԻԼԽԾԿՀՁՂՃՄՅՆՇՈՉՊՋՌՍՎՏՐՑՒՓՔՕՖևႠႡႢႣႤႥႦႧႨႩႪႫႬႭႮႯႰႱႲႳႴႵႶႷႸႹႺႻႼႽႾႿჀჁჂჃჄჅჇჍᏸᏹᏺᏻᏼᏽᲀᲁᲂᲃᲄᲅᲆᲇᲈᲐᲑᲒᲓᲔᲕᲖᲗᲘᲙᲚᲛᲜᲝᲞᲟᲠᲡᲢᲣᲤᲥᲦᲧᲨᲩᲪᲫᲬᲭᲮᲯᲰᲱᲲᲳᲴᲵᲶᲷᲸᲹᲺᲽᲾᲿḀḂḄḆḈḊḌḎḐḒḔḖḘḚḜḞḠḢḤḦḨḪḬḮḰḲḴḶḸḺḼḾṀṂṄṆṈṊṌṎṐṒṔṖṘṚṜṞṠṢṤṦṨṪṬṮṰṲṴṶṸṺṼṾẀẂẄẆẈẊẌẎẐẒẔẖẗẘẙẚẛẞẞẠẢẤẦẨẪẬẮẰẲẴẶẸẺẼẾỀỂỄỆỈỊỌỎỐỒỔỖỘỚỜỞỠỢỤỦỨỪỬỮỰỲỴỶỸỺỼỾἈἉἊἋἌἍἎἏἘἙἚἛἜἝἨἩἪἫἬἭἮἯἸἹἺἻἼἽἾἿὈὉὊὋὌὍὐὒὔὖὙὛὝὟὨὩὪὫὬὭὮὯᾀᾁᾂᾃᾄᾅᾆᾇᾈᾈᾉᾉᾊᾊᾋᾋᾌᾌᾍᾍᾎᾎᾏᾏᾐᾑᾒᾓᾔᾕᾖᾗᾘᾘᾙᾙᾚᾚᾛᾛᾜᾜᾝᾝᾞᾞᾟᾟᾠᾡᾢᾣᾤᾥᾦᾧᾨᾨᾩᾩᾪᾪᾫᾫᾬᾬᾭᾭᾮᾮᾯᾯᾲᾳᾴᾶᾷᾸᾹᾺΆᾼᾼιῂῃῄῆῇῈΈῊΉῌῌῒΐῖῗῘῙῚΊῢΰῤῦῧῨῩῪΎῬῲῳῴῶῷῸΌῺΏῼῼΩKÅℲⅠⅡⅢⅣⅤⅥⅦⅧⅨⅩⅪⅫⅬⅭⅮⅯↃⒶⒷⒸⒹⒺⒻⒼⒽⒾⒿⓀⓁⓂⓃⓄⓅⓆⓇⓈⓉⓊⓋⓌⓍⓎⓏⰀⰁⰂⰃⰄⰅⰆⰇⰈⰉⰊⰋⰌⰍⰎⰏⰐⰑⰒⰓⰔⰕⰖⰗⰘⰙⰚⰛⰜⰝⰞⰟⰠⰡⰢⰣⰤⰥⰦⰧⰨⰩⰪⰫⰬⰭⰮⱠⱢⱣⱤⱧⱩⱫⱭⱮⱯⱰⱲⱵⱾⱿⲀⲂⲄⲆⲈⲊⲌⲎⲐⲒⲔⲖⲘⲚⲜⲞⲠⲢⲤⲦⲨⲪⲬⲮⲰⲲⲴⲶⲸⲺⲼⲾⳀⳂⳄⳆⳈⳊⳌⳎⳐⳒⳔⳖⳘⳚⳜⳞⳠⳢⳫⳭⳲ

Lowercase Characters
abcdefghiıjklmnopqrstuvwxyzμàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþssāăąćĉċčďđēĕėęěĝğġģĥħĩīĭįi̇iĳĵķĺļľŀłńņňʼnŋōŏőœŕŗřśŝşšţťŧũūŭůűųŵŷÿźżžsɓƃƅɔƈɖɗƌǝəɛƒɠɣɩɨƙɯɲɵơƣƥʀƨʃƭʈưʊʋƴƶʒƹƽǆǆǉǉǌǌǎǐǒǔǖǘǚǜǟǡǣǥǧǩǫǭǯǰǳǳǵƕƿǹǻǽǿȁȃȅȇȉȋȍȏȑȓȕȗșțȝȟƞȣȥȧȩȫȭȯȱȳⱥȼƚⱦɂƀʉʌɇɉɋɍɏιͱͳͷϳάέήίόύώΐαβγδεζηθικλμνξοπρστυφχψωϊϋΰσϗβθφπϙϛϝϟϡϣϥϧϩϫϭϯκρθεϸϲϻͻͼͽѐёђѓєѕіїјљњћќѝўџабвгдежзийклмнопрстуфхцчшщъыьэюяѡѣѥѧѩѫѭѯѱѳѵѷѹѻѽѿҁҋҍҏґғҕҗҙқҝҟҡңҥҧҩҫҭүұҳҵҷҹһҽҿӏӂӄӆӈӊӌӎӑӓӕӗәӛӝӟӡӣӥӧөӫӭӯӱӳӵӷӹӻӽӿԁԃԅԇԉԋԍԏԑԓԕԗԙԛԝԟԡԣԥԧԩԫԭԯաբգդեզէըթժիլխծկհձղճմյնշոչպջռսվտրցւփքօֆեւⴀⴁⴂⴃⴄⴅⴆⴇⴈⴉⴊⴋⴌⴍⴎⴏⴐⴑⴒⴓⴔⴕⴖⴗⴘⴙⴚⴛⴜⴝⴞⴟⴠⴡⴢⴣⴤⴥⴧⴭᏰᏱᏲᏳᏴᏵвдосттъѣꙋაბგდევზთიკლმნოპჟრსტუფქღყშჩცძწჭხჯჰჱჲჳჴჵჶჷჸჹჺჽჾჿḁḃḅḇḉḋḍḏḑḓḕḗḙḛḝḟḡḣḥḧḩḫḭḯḱḳḵḷḹḻḽḿṁṃṅṇṉṋṍṏṑṓṕṗṙṛṝṟṡṣṥṧṩṫṭṯṱṳṵṷṹṻṽṿẁẃẅẇẉẋẍẏẑẓẕẖẗẘẙaʾṡssßạảấầẩẫậắằẳẵặẹẻẽếềểễệỉịọỏốồổỗộớờởỡợụủứừửữựỳỵỷỹỻỽỿἀἁἂἃἄἅἆἇἐἑἒἓἔἕἠἡἢἣἤἥἦἧἰἱἲἳἴἵἶἷὀὁὂὃὄὅὐὒὔὖὑὓὕὗὠὡὢὣὤὥὦὧἀιἁιἂιἃιἄιἅιἆιἇιἀιᾀἁιᾁἂιᾂἃιᾃἄιᾄἅιᾅἆιᾆἇιᾇἠιἡιἢιἣιἤιἥιἦιἧιἠιᾐἡιᾑἢιᾒἣιᾓἤιᾔἥιᾕἦιᾖἧιᾗὠιὡιὢιὣιὤιὥιὦιὧιὠιᾠὡιᾡὢιᾢὣιᾣὤιᾤὥιᾥὦιᾦὧιᾧὰιαιάιᾶᾶιᾰᾱὰάαιᾳιὴιηιήιῆῆιὲέὴήηιῃῒΐῖῗῐῑὶίῢΰῤῦῧῠῡὺύῥὼιωιώιῶῶιὸόὼώωιῳωkåⅎⅰⅱⅲⅳⅴⅵⅶⅷⅸⅹⅺⅻⅼⅽⅾⅿↄⓐⓑⓒⓓⓔⓕⓖⓗⓘⓙⓚⓛⓜⓝⓞⓟⓠⓡⓢⓣⓤⓥⓦⓧⓨⓩⰰⰱⰲⰳⰴⰵⰶⰷⰸⰹⰺⰻⰼⰽⰾⰿⱀⱁⱂⱃⱄⱅⱆⱇⱈⱉⱊⱋⱌⱍⱎⱏⱐⱑⱒⱓⱔⱕⱖⱗⱘⱙⱚⱛⱜⱝⱞⱡɫᵽɽⱨⱪⱬɑɱɐɒⱳⱶȿɀⲁⲃⲅⲇⲉⲋⲍⲏⲑⲓⲕⲗⲙⲛⲝⲟⲡⲣⲥⲧⲩⲫⲭⲯⲱⲳⲵⲷⲹⲻⲽⲿⳁⳃⳅⳇⳉⳋⳍⳏⳑⳓⳕⳗⳙⳛⳝⳟⳡⳣⳬⳮⳳ

Uppercase Codepoints
0041, 0042, 0043, 0044, 0045, 0046, 0047, 0048, 0049, 0049, 004A, 004B, 004C, 004D, 004E, 004F, 0050, 0051, 0052, 0053, 0054, 0055, 0056, 0057, 0058, 0059, 005A, 00B5, 00C0, 00C1, 00C2, 00C3, 00C4, 00C5, 00C6, 00C7, 00C8, 00C9, 00CA, 00CB, 00CC, 00CD, 00CE, 00CF, 00D0, 00D1, 00D2, 00D3, 00D4, 00D5, 00D6, 00D8, 00D9, 00DA, 00DB, 00DC, 00DD, 00DE, 00DF, 0100, 0102, 0104, 0106, 0108, 010A, 010C, 010E, 0110, 0112, 0114, 0116, 0118, 011A, 011C, 011E, 0120, 0122, 0124, 0126, 0128, 012A, 012C, 012E, 0130, 0130, 0132, 0134, 0136, 0139, 013B, 013D, 013F, 0141, 0143, 0145, 0147, 0149, 014A, 014C, 014E, 0150, 0152, 0154, 0156, 0158, 015A, 015C, 015E, 0160, 0162, 0164, 0166, 0168, 016A, 016C, 016E, 0170, 0172, 0174, 0176, 0178, 0179, 017B, 017D, 017F, 0181, 0182, 0184, 0186, 0187, 0189, 018A, 018B, 018E, 018F, 0190, 0191, 0193, 0194, 0196, 0197, 0198, 019C, 019D, 019F, 01A0, 01A2, 01A4, 01A6, 01A7, 01A9, 01AC, 01AE, 01AF, 01B1, 01B2, 01B3, 01B5, 01B7, 01B8, 01BC, 01C4, 01C5, 01C7, 01C8, 01CA, 01CB, 01CD, 01CF, 01D1, 01D3, 01D5, 01D7, 01D9, 01DB, 01DE, 01E0, 01E2, 01E4, 01E6, 01E8, 01EA, 01EC, 01EE, 01F0, 01F1, 01F2, 01F4, 01F6, 01F7, 01F8, 01FA, 01FC, 01FE, 0200, 0202, 0204, 0206, 0208, 020A, 020C, 020E, 0210, 0212, 0214, 0216, 0218, 021A, 021C, 021E, 0220, 0222, 0224, 0226, 0228, 022A, 022C, 022E, 0230, 0232, 023A, 023B, 023D, 023E, 0241, 0243, 0244, 0245, 0246, 0248, 024A, 024C, 024E, 0345, 0370, 0372, 0376, 037F, 0386, 0388, 0389, 038A, 038C, 038E, 038F, 0390, 0391, 0392, 0393, 0394, 0395, 0396, 0397, 0398, 0399, 039A, 039B, 039C, 039D, 039E, 039F, 03A0, 03A1, 03A3, 03A4, 03A5, 03A6, 03A7, 03A8, 03A9, 03AA, 03AB, 03B0, 03C2, 03CF, 03D0, 03D1, 03D5, 03D6, 03D8, 03DA, 03DC, 03DE, 03E0, 03E2, 03E4, 03E6, 03E8, 03EA, 03EC, 03EE, 03F0, 03F1, 03F4, 03F5, 03F7, 03F9, 03FA, 03FD, 03FE, 03FF, 0400, 0401, 0402, 0403, 0404, 0405, 0406, 0407, 0408, 0409, 040A, 040B, 040C, 040D, 040E, 040F, 0410, 0411, 0412, 0413, 0414, 0415, 0416, 0417, 0418, 0419, 041A, 041B, 041C, 041D, 041E, 041F, 0420, 0421, 0422, 0423, 0424, 0425, 0426, 0427, 0428, 0429, 042A, 042B, 042C, 042D, 042E, 042F, 0460, 0462, 0464, 0466, 0468, 046A, 046C, 046E, 0470, 0472, 0474, 0476, 0478, 047A, 047C, 047E, 0480, 048A, 048C, 048E, 0490, 0492, 0494, 0496, 0498, 049A, 049C, 049E, 04A0, 04A2, 04A4, 04A6, 04A8, 04AA, 04AC, 04AE, 04B0, 04B2, 04B4, 04B6, 04B8, 04BA, 04BC, 04BE, 04C0, 04C1, 04C3, 04C5, 04C7, 04C9, 04CB, 04CD, 04D0, 04D2, 04D4, 04D6, 04D8, 04DA, 04DC, 04DE, 04E0, 04E2, 04E4, 04E6, 04E8, 04EA, 04EC, 04EE, 04F0, 04F2, 04F4, 04F6, 04F8, 04FA, 04FC, 04FE, 0500, 0502, 0504, 0506, 0508, 050A, 050C, 050E, 0510, 0512, 0514, 0516, 0518, 051A, 051C, 051E, 0520, 0522, 0524, 0526, 0528, 052A, 052C, 052E, 0531, 0532, 0533, 0534, 0535, 0536, 0537, 0538, 0539, 053A, 053B, 053C, 053D, 053E, 053F, 0540, 0541, 0542, 0543, 0544, 0545, 0546, 0547, 0548, 0549, 054A, 054B, 054C, 054D, 054E, 054F, 0550, 0551, 0552, 0553, 0554, 0555, 0556, 0587, 10A0, 10A1, 10A2, 10A3, 10A4, 10A5, 10A6, 10A7, 10A8, 10A9, 10AA, 10AB, 10AC, 10AD, 10AE, 10AF, 10B0, 10B1, 10B2, 10B3, 10B4, 10B5, 10B6, 10B7, 10B8, 10B9, 10BA, 10BB, 10BC, 10BD, 10BE, 10BF, 10C0, 10C1, 10C2, 10C3, 10C4, 10C5, 10C7, 10CD, 13F8, 13F9, 13FA, 13FB, 13FC, 13FD, 1C80, 1C81, 1C82, 1C83, 1C84, 1C85, 1C86, 1C87, 1C88, 1C90, 1C91, 1C92, 1C93, 1C94, 1C95, 1C96, 1C97, 1C98, 1C99, 1C9A, 1C9B, 1C9C, 1C9D, 1C9E, 1C9F, 1CA0, 1CA1, 1CA2, 1CA3, 1CA4, 1CA5, 1CA6, 1CA7, 1CA8, 1CA9, 1CAA, 1CAB, 1CAC, 1CAD, 1CAE, 1CAF, 1CB0, 1CB1, 1CB2, 1CB3, 1CB4, 1CB5, 1CB6, 1CB7, 1CB8, 1CB9, 1CBA, 1CBD, 1CBE, 1CBF, 1E00, 1E02, 1E04, 1E06, 1E08, 1E0A, 1E0C, 1E0E, 1E10, 1E12, 1E14, 1E16, 1E18, 1E1A, 1E1C, 1E1E, 1E20, 1E22, 1E24, 1E26, 1E28, 1E2A, 1E2C, 1E2E, 1E30, 1E32, 1E34, 1E36, 1E38, 1E3A, 1E3C, 1E3E, 1E40, 1E42, 1E44, 1E46, 1E48, 1E4A, 1E4C, 1E4E, 1E50, 1E52, 1E54, 1E56, 1E58, 1E5A, 1E5C, 1E5E, 1E60, 1E62, 1E64, 1E66, 1E68, 1E6A, 1E6C, 1E6E, 1E70, 1E72, 1E74, 1E76, 1E78, 1E7A, 1E7C, 1E7E, 1E80, 1E82, 1E84, 1E86, 1E88, 1E8A, 1E8C, 1E8E, 1E90, 1E92, 1E94, 1E96, 1E97, 1E98, 1E99, 1E9A, 1E9B, 1E9E, 1E9E, 1EA0, 1EA2, 1EA4, 1EA6, 1EA8, 1EAA, 1EAC, 1EAE, 1EB0, 1EB2, 1EB4, 1EB6, 1EB8, 1EBA, 1EBC, 1EBE, 1EC0, 1EC2, 1EC4, 1EC6, 1EC8, 1ECA, 1ECC, 1ECE, 1ED0, 1ED2, 1ED4, 1ED6, 1ED8, 1EDA, 1EDC, 1EDE, 1EE0, 1EE2, 1EE4, 1EE6, 1EE8, 1EEA, 1EEC, 1EEE, 1EF0, 1EF2, 1EF4, 1EF6, 1EF8, 1EFA, 1EFC, 1EFE, 1F08, 1F09, 1F0A, 1F0B, 1F0C, 1F0D, 1F0E, 1F0F, 1F18, 1F19, 1F1A, 1F1B, 1F1C, 1F1D, 1F28, 1F29, 1F2A, 1F2B, 1F2C, 1F2D, 1F2E, 1F2F, 1F38, 1F39, 1F3A, 1F3B, 1F3C, 1F3D, 1F3E, 1F3F, 1F48, 1F49, 1F4A, 1F4B, 1F4C, 1F4D, 1F50, 1F52, 1F54, 1F56, 1F59, 1F5B, 1F5D, 1F5F, 1F68, 1F69, 1F6A, 1F6B, 1F6C, 1F6D, 1F6E, 1F6F, 1F80, 1F81, 1F82, 1F83, 1F84, 1F85, 1F86, 1F87, 1F88, 1F88, 1F89, 1F89, 1F8A, 1F8A, 1F8B, 1F8B, 1F8C, 1F8C, 1F8D, 1F8D, 1F8E, 1F8E, 1F8F, 1F8F, 1F90, 1F91, 1F92, 1F93, 1F94, 1F95, 1F96, 1F97, 1F98, 1F98, 1F99, 1F99, 1F9A, 1F9A, 1F9B, 1F9B, 1F9C, 1F9C, 1F9D, 1F9D, 1F9E, 1F9E, 1F9F, 1F9F, 1FA0, 1FA1, 1FA2, 1FA3, 1FA4, 1FA5, 1FA6, 1FA7, 1FA8, 1FA8, 1FA9, 1FA9, 1FAA, 1FAA, 1FAB, 1FAB, 1FAC, 1FAC, 1FAD, 1FAD, 1FAE, 1FAE, 1FAF, 1FAF, 1FB2, 1FB3, 1FB4, 1FB6, 1FB7, 1FB8, 1FB9, 1FBA, 1FBB, 1FBC, 1FBC, 1FBE, 1FC2, 1FC3, 1FC4, 1FC6, 1FC7, 1FC8, 1FC9, 1FCA, 1FCB, 1FCC, 1FCC, 1FD2, 1FD3, 1FD6, 1FD7, 1FD8, 1FD9, 1FDA, 1FDB, 1FE2, 1FE3, 1FE4, 1FE6, 1FE7, 1FE8, 1FE9, 1FEA, 1FEB, 1FEC, 1FF2, 1FF3, 1FF4, 1FF6, 1FF7, 1FF8, 1FF9, 1FFA, 1FFB, 1FFC, 1FFC, 2126, 212A, 212B, 2132, 2160, 2161, 2162, 2163, 2164, 2165, 2166, 2167, 2168, 2169, 216A, 216B, 216C, 216D, 216E, 216F, 2183, 24B6, 24B7, 24B8, 24B9, 24BA, 24BB, 24BC, 24BD, 24BE, 24BF, 24C0, 24C1, 24C2, 24C3, 24C4, 24C5, 24C6, 24C7, 24C8, 24C9, 24CA, 24CB, 24CC, 24CD, 24CE, 24CF, 2C00, 2C01, 2C02, 2C03, 2C04, 2C05, 2C06, 2C07, 2C08, 2C09, 2C0A, 2C0B, 2C0C, 2C0D, 2C0E, 2C0F, 2C10, 2C11, 2C12, 2C13, 2C14, 2C15, 2C16, 2C17, 2C18, 2C19, 2C1A, 2C1B, 2C1C, 2C1D, 2C1E, 2C1F, 2C20, 2C21, 2C22, 2C23, 2C24, 2C25, 2C26, 2C27, 2C28, 2C29, 2C2A, 2C2B, 2C2C, 2C2D, 2C2E, 2C60, 2C62, 2C63, 2C64, 2C67, 2C69, 2C6B, 2C6D, 2C6E, 2C6F, 2C70, 2C72, 2C75, 2C7E, 2C7F, 2C80, 2C82, 2C84, 2C86, 2C88, 2C8A, 2C8C, 2C8E, 2C90, 2C92, 2C94, 2C96, 2C98, 2C9A, 2C9C, 2C9E, 2CA0, 2CA2, 2CA4, 2CA6, 2CA8, 2CAA, 2CAC, 2CAE, 2CB0, 2CB2, 2CB4, 2CB6, 2CB8, 2CBA, 2CBC, 2CBE, 2CC0, 2CC2, 2CC4, 2CC6, 2CC8, 2CCA, 2CCC, 2CCE, 2CD0, 2CD2, 2CD4, 2CD6, 2CD8, 2CDA, 2CDC, 2CDE, 2CE0, 2CE2, 2CEB, 2CED, 2CF2, 10400, 10401, 10402, 10403, 10404, 10405, 10406, 10407, 10408, 10409, 1040A, 1040B, 1040C, 1040D, 1040E, 1040F, 10410, 10411, 10412, 10413, 10414, 10415, 10416, 10417, 10418, 10419, 1041A, 1041B, 1041C, 1041D, 1041E, 1041F, 10420, 10421, 10422, 10423, 10424, 10425, 10426, 10427, 104B0, 104B1, 104B2, 104B3, 104B4, 104B5, 104B6, 104B7, 104B8, 104B9, 104BA, 104BB, 104BC, 104BD, 104BE, 104BF, 104C0, 104C1, 104C2, 104C3, 104C4, 104C5, 104C6, 104C7, 104C8, 104C9, 104CA, 104CB, 104CC, 104CD, 104CE, 104CF, 104D0, 104D1, 104D2, 104D3, 10C80, 10C81, 10C82, 10C83, 10C84, 10C85, 10C86, 10C87, 10C88, 10C89, 10C8A, 10C8B, 10C8C, 10C8D, 10C8E, 10C8F, 10C90, 10C91, 10C92, 10C93, 10C94, 10C95, 10C96, 10C97, 10C98, 10C99, 10C9A, 10C9B, 10C9C, 10C9D, 10C9E, 10C9F, 10CA0, 10CA1, 10CA2, 10CA3, 10CA4, 10CA5, 10CA6, 10CA7, 10CA8, 10CA9, 10CAA, 10CAB, 10CAC, 10CAD, 10CAE, 10CAF, 10CB0, 10CB1, 10CB2, 118A0, 118A1, 118A2, 118A3, 118A4, 118A5, 118A6, 118A7, 118A8, 118A9, 118AA, 118AB, 118AC, 118AD, 118AE, 118AF, 118B0, 118B1, 118B2, 118B3, 118B4, 118B5, 118B6, 118B7, 118B8, 118B9, 118BA, 118BB, 118BC, 118BD, 118BE, 118BF, 16E40, 16E41, 16E42, 16E43, 16E44, 16E45, 16E46, 16E47, 16E48, 16E49, 16E4A, 16E4B, 16E4C, 16E4D, 16E4E, 16E4F, 16E50, 16E51, 16E52, 16E53, 16E54, 16E55, 16E56, 16E57, 16E58, 16E59, 16E5A, 16E5B, 16E5C, 16E5D, 16E5E, 16E5F, 1E900, 1E901, 1E902, 1E903, 1E904, 1E905, 1E906, 1E907, 1E908, 1E909, 1E90A, 1E90B, 1E90C, 1E90D, 1E90E, 1E90F, 1E910, 1E911, 1E912, 1E913, 1E914, 1E915, 1E916, 1E917, 1E918, 1E919, 1E91A, 1E91B, 1E91C, 1E91D, 1E91E, 1E91F, 1E920, 1E921

Lowercase Codepoints
0061, 0062, 0063, 0064, 0065, 0066, 0067, 0068, 0069, 0131, 006A, 006B, 006C, 006D, 006E, 006F, 0070, 0071, 0072, 0073, 0074, 0075, 0076, 0077, 0078, 0079, 007A, 03BC, 00E0, 00E1, 00E2, 00E3, 00E4, 00E5, 00E6, 00E7, 00E8, 00E9, 00EA, 00EB, 00EC, 00ED, 00EE, 00EF, 00F0, 00F1, 00F2, 00F3, 00F4, 00F5, 00F6, 00F8, 00F9, 00FA, 00FB, 00FC, 00FD, 00FE, 0073 0073, 0101, 0103, 0105, 0107, 0109, 010B, 010D, 010F, 0111, 0113, 0115, 0117, 0119, 011B, 011D, 011F, 0121, 0123, 0125, 0127, 0129, 012B, 012D, 012F, 0069 0307, 0069, 0133, 0135, 0137, 013A, 013C, 013E, 0140, 0142, 0144, 0146, 0148, 02BC 006E, 014B, 014D, 014F, 0151, 0153, 0155, 0157, 0159, 015B, 015D, 015F, 0161, 0163, 0165, 0167, 0169, 016B, 016D, 016F, 0171, 0173, 0175, 0177, 00FF, 017A, 017C, 017E, 0073, 0253, 0183, 0185, 0254, 0188, 0256, 0257, 018C, 01DD, 0259, 025B, 0192, 0260, 0263, 0269, 0268, 0199, 026F, 0272, 0275, 01A1, 01A3, 01A5, 0280, 01A8, 0283, 01AD, 0288, 01B0, 028A, 028B, 01B4, 01B6, 0292, 01B9, 01BD, 01C6, 01C6, 01C9, 01C9, 01CC, 01CC, 01CE, 01D0, 01D2, 01D4, 01D6, 01D8, 01DA, 01DC, 01DF, 01E1, 01E3, 01E5, 01E7, 01E9, 01EB, 01ED, 01EF, 006A 030C, 01F3, 01F3, 01F5, 0195, 01BF, 01F9, 01FB, 01FD, 01FF, 0201, 0203, 0205, 0207, 0209, 020B, 020D, 020F, 0211, 0213, 0215, 0217, 0219, 021B, 021D, 021F, 019E, 0223, 0225, 0227, 0229, 022B, 022D, 022F, 0231, 0233, 2C65, 023C, 019A, 2C66, 0242, 0180, 0289, 028C, 0247, 0249, 024B, 024D, 024F, 03B9, 0371, 0373, 0377, 03F3, 03AC, 03AD, 03AE, 03AF, 03CC, 03CD, 03CE, 03B9 0308 0301, 03B1, 03B2, 03B3, 03B4, 03B5, 03B6, 03B7, 03B8, 03B9, 03BA, 03BB, 03BC, 03BD, 03BE, 03BF, 03C0, 03C1, 03C3, 03C4, 03C5, 03C6, 03C7, 03C8, 03C9, 03CA, 03CB, 03C5 0308 0301, 03C3, 03D7, 03B2, 03B8, 03C6, 03C0, 03D9, 03DB, 03DD, 03DF, 03E1, 03E3, 03E5, 03E7, 03E9, 03EB, 03ED, 03EF, 03BA, 03C1, 03B8, 03B5, 03F8, 03F2, 03FB, 037B, 037C, 037D, 0450, 0451, 0452, 0453, 0454, 0455, 0456, 0457, 0458, 0459, 045A, 045B, 045C, 045D, 045E, 045F, 0430, 0431, 0432, 0433, 0434, 0435, 0436, 0437, 0438, 0439, 043A, 043B, 043C, 043D, 043E, 043F, 0440, 0441, 0442, 0443, 0444, 0445, 0446, 0447, 0448, 0449, 044A, 044B, 044C, 044D, 044E, 044F, 0461, 0463, 0465, 0467, 0469, 046B, 046D, 046F, 0471, 0473, 0475, 0477, 0479, 047B, 047D, 047F, 0481, 048B, 048D, 048F, 0491, 0493, 0495, 0497, 0499, 049B, 049D, 049F, 04A1, 04A3, 04A5, 04A7, 04A9, 04AB, 04AD, 04AF, 04B1, 04B3, 04B5, 04B7, 04B9, 04BB, 04BD, 04BF, 04CF, 04C2, 04C4, 04C6, 04C8, 04CA, 04CC, 04CE, 04D1, 04D3, 04D5, 04D7, 04D9, 04DB, 04DD, 04DF, 04E1, 04E3, 04E5, 04E7, 04E9, 04EB, 04ED, 04EF, 04F1, 04F3, 04F5, 04F7, 04F9, 04FB, 04FD, 04FF, 0501, 0503, 0505, 0507, 0509, 050B, 050D, 050F, 0511, 0513, 0515, 0517, 0519, 051B, 051D, 051F, 0521, 0523, 0525, 0527, 0529, 052B, 052D, 052F, 0561, 0562, 0563, 0564, 0565, 0566, 0567, 0568, 0569, 056A, 056B, 056C, 056D, 056E, 056F, 0570, 0571, 0572, 0573, 0574, 0575, 0576, 0577, 0578, 0579, 057A, 057B, 057C, 057D, 057E, 057F, 0580, 0581, 0582, 0583, 0584, 0585, 0586, 0565 0582, 2D00, 2D01, 2D02, 2D03, 2D04, 2D05, 2D06, 2D07, 2D08, 2D09, 2D0A, 2D0B, 2D0C, 2D0D, 2D0E, 2D0F, 2D10, 2D11, 2D12, 2D13, 2D14, 2D15, 2D16, 2D17, 2D18, 2D19, 2D1A, 2D1B, 2D1C, 2D1D, 2D1E, 2D1F, 2D20, 2D21, 2D22, 2D23, 2D24, 2D25, 2D27, 2D2D, 13F0, 13F1, 13F2, 13F3, 13F4, 13F5, 0432, 0434, 043E, 0441, 0442, 0442, 044A, 0463, A64B, 10D0, 10D1, 10D2, 10D3, 10D4, 10D5, 10D6, 10D7, 10D8, 10D9, 10DA, 10DB, 10DC, 10DD, 10DE, 10DF, 10E0, 10E1, 10E2, 10E3, 10E4, 10E5, 10E6, 10E7, 10E8, 10E9, 10EA, 10EB, 10EC, 10ED, 10EE, 10EF, 10F0, 10F1, 10F2, 10F3, 10F4, 10F5, 10F6, 10F7, 10F8, 10F9, 10FA, 10FD, 10FE, 10FF, 1E01, 1E03, 1E05, 1E07, 1E09, 1E0B, 1E0D, 1E0F, 1E11, 1E13, 1E15, 1E17, 1E19, 1E1B, 1E1D, 1E1F, 1E21, 1E23, 1E25, 1E27, 1E29, 1E2B, 1E2D, 1E2F, 1E31, 1E33, 1E35, 1E37, 1E39, 1E3B, 1E3D, 1E3F, 1E41, 1E43, 1E45, 1E47, 1E49, 1E4B, 1E4D, 1E4F, 1E51, 1E53, 1E55, 1E57, 1E59, 1E5B, 1E5D, 1E5F, 1E61, 1E63, 1E65, 1E67, 1E69, 1E6B, 1E6D, 1E6F, 1E71, 1E73, 1E75, 1E77, 1E79, 1E7B, 1E7D, 1E7F, 1E81, 1E83, 1E85, 1E87, 1E89, 1E8B, 1E8D, 1E8F, 1E91, 1E93, 1E95, 0068 0331, 0074 0308, 0077 030A, 0079 030A, 0061 02BE, 1E61, 0073 0073, 00DF, 1EA1, 1EA3, 1EA5, 1EA7, 1EA9, 1EAB, 1EAD, 1EAF, 1EB1, 1EB3, 1EB5, 1EB7, 1EB9, 1EBB, 1EBD, 1EBF, 1EC1, 1EC3, 1EC5, 1EC7, 1EC9, 1ECB, 1ECD, 1ECF, 1ED1, 1ED3, 1ED5, 1ED7, 1ED9, 1EDB, 1EDD, 1EDF, 1EE1, 1EE3, 1EE5, 1EE7, 1EE9, 1EEB, 1EED, 1EEF, 1EF1, 1EF3, 1EF5, 1EF7, 1EF9, 1EFB, 1EFD, 1EFF, 1F00, 1F01, 1F02, 1F03, 1F04, 1F05, 1F06, 1F07, 1F10, 1F11, 1F12, 1F13, 1F14, 1F15, 1F20, 1F21, 1F22, 1F23, 1F24, 1F25, 1F26, 1F27, 1F30, 1F31, 1F32, 1F33, 1F34, 1F35, 1F36, 1F37, 1F40, 1F41, 1F42, 1F43, 1F44, 1F45, 03C5 0313, 03C5 0313 0300, 03C5 0313 0301, 03C5 0313 0342, 1F51, 1F53, 1F55, 1F57, 1F60, 1F61, 1F62, 1F63, 1F64, 1F65, 1F66, 1F67, 1F00 03B9, 1F01 03B9, 1F02 03B9, 1F03 03B9, 1F04 03B9, 1F05 03B9, 1F06 03B9, 1F07 03B9, 1F00 03B9, 1F80, 1F01 03B9, 1F81, 1F02 03B9, 1F82, 1F03 03B9, 1F83, 1F04 03B9, 1F84, 1F05 03B9, 1F85, 1F06 03B9, 1F86, 1F07 03B9, 1F87, 1F20 03B9, 1F21 03B9, 1F22 03B9, 1F23 03B9, 1F24 03B9, 1F25 03B9, 1F26 03B9, 1F27 03B9, 1F20 03B9, 1F90, 1F21 03B9, 1F91, 1F22 03B9, 1F92, 1F23 03B9, 1F93, 1F24 03B9, 1F94, 1F25 03B9, 1F95, 1F26 03B9, 1F96, 1F27 03B9, 1F97, 1F60 03B9, 1F61 03B9, 1F62 03B9, 1F63 03B9, 1F64 03B9, 1F65 03B9, 1F66 03B9, 1F67 03B9, 1F60 03B9, 1FA0, 1F61 03B9, 1FA1, 1F62 03B9, 1FA2, 1F63 03B9, 1FA3, 1F64 03B9, 1FA4, 1F65 03B9, 1FA5, 1F66 03B9, 1FA6, 1F67 03B9, 1FA7, 1F70 03B9, 03B1 03B9, 03AC 03B9, 03B1 0342, 03B1 0342 03B9, 1FB0, 1FB1, 1F70, 1F71, 03B1 03B9, 1FB3, 03B9, 1F74 03B9, 03B7 03B9, 03AE 03B9, 03B7 0342, 03B7 0342 03B9, 1F72, 1F73, 1F74, 1F75, 03B7 03B9, 1FC3, 03B9 0308 0300, 03B9 0308 0301, 03B9 0342, 03B9 0308 0342, 1FD0, 1FD1, 1F76, 1F77, 03C5 0308 0300, 03C5 0308 0301, 03C1 0313, 03C5 0342, 03C5 0308 0342, 1FE0, 1FE1, 1F7A, 1F7B, 1FE5, 1F7C 03B9, 03C9 03B9, 03CE 03B9, 03C9 0342, 03C9 0342 03B9, 1F78, 1F79, 1F7C, 1F7D, 03C9 03B9, 1FF3, 03C9, 006B, 00E5, 214E, 2170, 2171, 2172, 2173, 2174, 2175, 2176, 2177, 2178, 2179, 217A, 217B, 217C, 217D, 217E, 217F, 2184, 24D0, 24D1, 24D2, 24D3, 24D4, 24D5, 24D6, 24D7, 24D8, 24D9, 24DA, 24DB, 24DC, 24DD, 24DE, 24DF, 24E0, 24E1, 24E2, 24E3, 24E4, 24E5, 24E6, 24E7, 24E8, 24E9, 2C30, 2C31, 2C32, 2C33, 2C34, 2C35, 2C36, 2C37, 2C38, 2C39, 2C3A, 2C3B, 2C3C, 2C3D, 2C3E, 2C3F, 2C40, 2C41, 2C42, 2C43, 2C44, 2C45, 2C46, 2C47, 2C48, 2C49, 2C4A, 2C4B, 2C4C, 2C4D, 2C4E, 2C4F, 2C50, 2C51, 2C52, 2C53, 2C54, 2C55, 2C56, 2C57, 2C58, 2C59, 2C5A, 2C5B, 2C5C, 2C5D, 2C5E, 2C61, 026B, 1D7D, 027D, 2C68, 2C6A, 2C6C, 0251, 0271, 0250, 0252, 2C73, 2C76, 023F, 0240, 2C81, 2C83, 2C85, 2C87, 2C89, 2C8B, 2C8D, 2C8F, 2C91, 2C93, 2C95, 2C97, 2C99, 2C9B, 2C9D, 2C9F, 2CA1, 2CA3, 2CA5, 2CA7, 2CA9, 2CAB, 2CAD, 2CAF, 2CB1, 2CB3, 2CB5, 2CB7, 2CB9, 2CBB, 2CBD, 2CBF, 2CC1, 2CC3, 2CC5, 2CC7, 2CC9, 2CCB, 2CCD, 2CCF, 2CD1, 2CD3, 2CD5, 2CD7, 2CD9, 2CDB, 2CDD, 2CDF, 2CE1, 2CE3, 2CEC, 2CEE, 2CF3, 10428, 10429, 1042A, 1042B, 1042C, 1042D, 1042E, 1042F, 10430, 10431, 10432, 10433, 10434, 10435, 10436, 10437, 10438, 10439, 1043A, 1043B, 1043C, 1043D, 1043E, 1043F, 10440, 10441, 10442, 10443, 10444, 10445, 10446, 10447, 10448, 10449, 1044A, 1044B, 1044C, 1044D, 1044E, 1044F, 104D8, 104D9, 104DA, 104DB, 104DC, 104DD, 104DE, 104DF, 104E0, 104E1, 104E2, 104E3, 104E4, 104E5, 104E6, 104E7, 104E8, 104E9, 104EA, 104EB, 104EC, 104ED, 104EE, 104EF, 104F0, 104F1, 104F2, 104F3, 104F4, 104F5, 104F6, 104F7, 104F8, 104F9, 104FA, 104FB, 10CC0, 10CC1, 10CC2, 10CC3, 10CC4, 10CC5, 10CC6, 10CC7, 10CC8, 10CC9, 10CCA, 10CCB, 10CCC, 10CCD, 10CCE, 10CCF, 10CD0, 10CD1, 10CD2, 10CD3, 10CD4, 10CD5, 10CD6, 10CD7, 10CD8, 10CD9, 10CDA, 10CDB, 10CDC, 10CDD, 10CDE, 10CDF, 10CE0, 10CE1, 10CE2, 10CE3, 10CE4, 10CE5, 10CE6, 10CE7, 10CE8, 10CE9, 10CEA, 10CEB, 10CEC, 10CED, 10CEE, 10CEF, 10CF0, 10CF1, 10CF2, 118C0, 118C1, 118C2, 118C3, 118C4, 118C5, 118C6, 118C7, 118C8, 118C9, 118CA, 118CB, 118CC, 118CD, 118CE, 118CF, 118D0, 118D1, 118D2, 118D3, 118D4, 118D5, 118D6, 118D7, 118D8, 118D9, 118DA, 118DB, 118DC, 118DD, 118DE, 118DF, 16E60, 16E61, 16E62, 16E63, 16E64, 16E65, 16E66, 16E67, 16E68, 16E69, 16E6A, 16E6B, 16E6C, 16E6D, 16E6E, 16E6F, 16E70, 16E71, 16E72, 16E73, 16E74, 16E75, 16E76, 16E77, 16E78, 16E79, 16E7A, 16E7B, 16E7C, 16E7D, 16E7E, 16E7F, 1E922, 1E923, 1E924, 1E925, 1E926, 1E927, 1E928, 1E929, 1E92A, 1E92B, 1E92C, 1E92D, 1E92E, 1E92F, 1E930, 1E931, 1E932, 1E933, 1E934, 1E935, 1E936, 1E937, 1E938, 1E939, 1E93A, 1E93B, 1E93C, 1E93D, 1E93E, 1E93F, 1E940, 1E941, 1E942, 1E943

@FryAmTheEggman Your program's encoding doesn't necessarily have to map to ASCII/Unicode one-to-one to determine which characters to remove, unless I'm mistaken?

@FryAmTheEggman Would it help to have answers specify their encodings, and different encodings in the same language compete separately?

What happens if the program doesn't contain uppercase character?

@SurculoseSputum Then there would be no way to know whether to lowercase the output or leave it unchanged.

@darrylyeo I think you need to make it a little more clear that there are three cases.

Google traslate thought that this question is in Vietnamese.

Really interesting challenge. It basically boils down to: 1) write a program with no uppercase letters that lowercases; 2) write a program with no lowercase letters that uppercases; 3) combine those two. I'm not sure if 1 and 2 are possible in JavaScript. I can write a function write iterates over a string and does something depending on the case of each letter, but I can't yet think of how to actually convert a 'c' into a 'C' without using a function like toUpperCase() etc.

It may be a good idea to allow functions as well, since a lot of languages are unable to print or read input without using letters (also there are already a few answers which use functions instead of programs).

IMO, When someone try to design a programming language, using any features based on lower / upper case letters is a bad idea.

Now claim 壹 is uppercase of 一

What characters do we have to handle in the input? Just letters? Or is anything fair game?

@dfeuer You must transform the basic Latin characters [A-Za-z]. Any characters beyond that range is optional.

So it would be okay to transform "$#47" into "zxpq", or error out?

is ,. in brainfuck a valid solution?

@dfeuer Can you clarify what you mean? By default, the program should output its input unchanged.

The question is whether we're required to handle input other than upper and lower case ASCII.

@dfeuer Input characters without uppercase/lowercase counterparts should be left unchanged in the output. So $#47 should transform into $#47 in all three cases as none of those characters have uppercase/lowercase counterparts.

perl -p, 37 bytes
goto Aa_;A_:$_="\U$_";a_:$_=lc$_;Aa_:

Try it online!
Removing all lowercase letters leaves:
 A_;A_:$_="\U$_";_:$_=$_;A_:

Try it online!
Removing the upper case letters leaves:
goto a_;_:$_="\$_";a_:$_=lc$_;a_:

Try it online!
How it works? With nothing removed, control jumps to the end, leaving the input unmodified.
With the lowercase letters removed, we have the string A_ in void context (nothing happens), and then at label A_, we upper case the string, at label _, we have a no-op (assigning $_ to itself), and an empty statement at label A_. Finally, the result is printed.
With the upper case letters removed, we jump to label a_, which lower cases the string, and the result is printed.

Perl 5 + -p, 20 bytes
$_=0xE0?$_:lc"\lU$_"

Try it online!
With all uppercase removed.
With all lowercase removed.
Explanation
Because we're using the -p flag, the input is placed in$_ implicitly and $_ is printed implicitly when the program terminates.
In the unmodified program, this checks 0xE0, which is 224, for truthiness and sets $_ to itself.
When all uppercase characters are removed 0xE0 becomes 0x0 which is 0 and the else block is reached which sets $_ to lc"\l$_". lc is Perl's lowercase function and converts the string to lowercase. \l is a string modifier that changes the immediately following character to lowercase, but this is irrelevant since it'll be lowered by the function call anyway.
When all lowercase characters are removed, 0xE0 becomes 0E0 which is 0 again, hitting the else block. Here we set $_ to "\U$_". \U is a strong modifier that makes the following part of the string uppercase.

Do you need the lc call? Seems like the \l handles that anyway.

@Neil Unfortunately \L lowercases the whole string, \l only does the character immediately to the right: Try it online!.

Ah, so the l is just a placeholder basically, so that there's still something after the \\?

Yeah, exactly. I tried to avoid having anything there but couldn't see a nice way to do it...

APL (Dyalog Extended), 14 bytes (SBCS)
Anonymous tacit prefix function. Unmodified function:
'AAb'≢⍛⊃⊂,⍨⌊⍮⌈

Leaves argument untouched: Try it online!
Without lowercase letters:
'AA'≢⍛⊃⊂,⍨⌊⍮⌈

Uppercase argument: Try it online!
Without uppercase letters:
'b'≢⍛⊃⊂,⍨⌊⍮⌈

Lowercases letters: Try it online!

⌈ the uppercased argument; "HELLO, WORLD!"
⍮ pair to:
 ⌊ the lowercased argument; [hello, world!","HELLO, WORLD!"]
,⍨ append:
 ⊂ the entire argument; [hello, world!","HELLO, WORLD!","Hello, world!"]
⊃ pick element number:
 ≢⍛ the length of:
  'AAb'/'AA'/'b' these three strings, i.e. number 3/2/1

Javascript 192 characters (without \123 literals)
$=>'Aa'[1]?$:'a'?$['to\u004cower\u0043ase']():
z/A/g&&([,A,,S,E,,O,,,,C]=!1+{},[T,R]=!0+$,[U,N,,,,I]=1[0]+$,$[T+O+'U'+1199331[T+O+'S'+T+R+I+N+($[C+O+N+S+T+R+U+C+T+O+R]+$)[14]](36)+'C'+A+S+E]())

Javascript 197 characters (without \123 literals)
$=>'Aa'[1]?$:'a'?$['to\u004cower\u0043ase']():
z/A/g&&([,O,,,E,C]={}+$,[,A,,S]=!1+$,[T,R]=!0+$,[U,N,,,,I]=1[0]+$,$[T+O+'U'+1199331[T+O+'S'+T+R+I+N+($[C+O+N+S+T+R+U+C+T+O+R]+$)[14]](36)+'C'+A+S+E]())

Javascript 204 208 226 234 characters (without \123 numeric literals)
$=>'Aa'[1]?$:'a'?$['to\u004cower\u0043ase']():
a/A/g&&([,O,,,E,C]=JSON+$,[,A,,S]=!1+$,[T,R]=!0+$,[U,N,,,,I]=1[0]+$,P=25[T+O+'S'+T+R+I+N+($[C+O+N+S+T+R+U+C+T+O+R]+$)[14]](36),$[T+O+'U'+P+P+E+R+'C'+A+S+E]())

r=
$=>'Aa'[1]?$:'a'?$['to\u004cower\u0043ase']():z/A/g&&([,A,,S,E,,O,,,,C]=!1+{},[T,R]=!0+$,[U,N,,,,I]=1[0]+$,$[T+O+'U'+1199331[T+O+'S'+T+R+I+N+($[C+O+N+S+T+R+U+C+T+O+R]+$)[14]](36)+'C'+A+S+E]())

console.log(eval(String(r))('Sentence Case'));
console.log(eval(String(r).replace(/[A-Z]/g, ''))('Lower Case'));
console.log(eval(String(r).replace(/[a-z]/g, ''))('Upper Case'));

I didn't realise that you could make arbitrary characters with \123. It's a much more interesting challenge without :)
A couple of comments:

Some of the concepts are inspired by JSFuck, although the constraints are different. There is fortunately one global object whose name is entirely upper case letters, JSON, so we can directly harvest quite a few letters from [object JSON]
Other letters come from true, false and undefined. We take the letters we need to write constructor, which then means we can find the string representation of a random string's constructor, which starts function String() {...
That g is the last ingredient we need to then form the method name toString(), which in base 36 lets us turn any number into an equivalent lowercase letter.

The only other thing of note here is that once we remove all the uppercase letters from this branch path, it's not syntactically correct. So we turn it all into a // comment with a regex /A/g which turns into a comment. We end up with three completely different syntaxes for the three modes:

No removals: a/A/g&&(... one undefined variable divided by another by another.
Remove lower case: /A/&&(... a regex (always truthy) and the rest of the expression
Remove upper case: a//g&&... an undefined variable and a comment.

Javascript 272 characters
$=>'Aa'=='\u0041\u0061'?$:'a'=='\u0061'?eval('$.to\u0055pper\u0043ase()'):(
[,O,,,E,C]=JSON+'',
[,A,,S]=(''+!1),
[T,R]=(''+!0),
[U,N,,,,I]=(''+1[0]),
Ka=Ca+Oa+Na+Sa+Ta+Ra+Ua+Ca+Ta+Oa+Ra,
Ga=(''[Ka]+'')[14],
$[Ta+Oa+'L'+Oa+(32)[Ta+Oa+'S'+Ta+Ra+Ia+Na+Ga](36)+Ea+Ra+'C'+Aa+Sa+Ea]())

(Linebreaks inserted for readability)
Room to golf, but pretty excited that it even works. Took a lot of inspiration from JSFuck.
Whoops, I realised I got the functionality backwards: when you remove uppercase letters it uppercases, etc.

Can you write pper together?

how do you mean? P,E and R are three different variables..

I mean $[T+O+'U'+697947..toString(30)+'C'+A+S+E]

Also why use JSON rather than {}?

Also claiming (without \123 numeric literals seems random assumption, does it work on strict mode?

Good point @l4m2

Also thanks, now I get what you mean about PPER - that helps!

Also - yeah, the without \123 literals is a totally arbitrary constraint, that came about because I didn't know about them. And the challenge is just so much more interesting this way. Probably I should not use the \u0099 literals either, to be slightly less arbitrary.

05AB1E, 20 9 bytes
Byte-count more than halved (-11) thanks to @Dorian!
Full program:
lIq.•L•.V

Try it online.
With uppercase characters removed; outputting in lowercase:
lq.••.

Try it online.
With lowercase characters removed; outputting in uppercase:
I.•L•.V

Try it online.
Explanation:
          # Full program:
l         #  Lowercase the (implicit) input
 I        #  Push the input again
  q       #  Stop the program, after which the top of the stack is output implicitly
   .•L•.V #  No-ops

          # Program with uppercase characters removed:
l         #  Lowercase the (implicit) input
 q        #  Stop the program, after which the top of the stack is output implicitly
  .••.    #  No-ops

          # Program with lowercase characters removed:
I         #  Push the input
 .•L•     #  Push compressed string "u"
     .V   #  Evaluate/execute it as 05AB1E code; uppercase the (implicit) input
          #  (after which the result is output implicitly)

See this 05AB1E tip of mine (section How to compress strings not part of the dictionary?) to understand why .•L• is "u".

Why do you push the compressed string "chr" when you could simply push the compressed String "l" (lowercase L)? uIq.•C•.V

I think the question is asking for the opposite way around: when lowercase characters are removed the output should be uppercased, not lowercased, and vice versa. I believe lIq.•L•.V should do that for you

Bash, 107 characters
cC=echoECHO
cC=${cC,,}
cC=${cC::4}
[ c ]||cC+=(${@^^})
[ C ]||cC+=(${@,,})
[[ cC = ?? ]]&&cC+=($@)
${cC[@]}

Try it online!

Ruby, 106 bytes
Full version:

$_=[*$<]*''
$.=0
o_=97
O_=65
@_=->{$_[__=''<<$.+_]?$_[__]=''<<$.+(_^32):$.+=1;$.<27&&@_[]}
_&&=@_[]
$><<$_

Try it online!
Uppercase:
$_=[*$<]*''
$.=0
_=97
O_=65
@_=->{$_[__=''<<$.+_]?$_[__]=''<<$.+(_^32):$.+=1;$.<27&&@_[]}
_&&=@_[]
$><<$_

Try it online!
Lowercase:
$_=[*$<]*''
$.=0
o_=97
_=65
@_=->{$_[__=''<<$.+_]?$_[__]=''<<$.+(_^32):$.+=1;$.<27&&@_[]}
_&&=@_[]
$><<$_

Try it online!
Explanation:
The verbose part here is all about the no-lower-case version. Avoiding lower-case characters means the string replacement needs to use the syntax str[from] = to, wrapped in a loop via a lambda that calls itself. The lambda is the variable @_ defined using @_=->, and it's called via @_[].
Stepping through...
$_=[*$<]*'' : Read multiline input into the variable $_. (Depending on your interpretation of the spec, this could just be $_,=*$< for single-line input or even happen implicitly via the -p flag).
$.=0: Initialize the variable we'll be using to iterate over the letters of the alphabet.
o_=97: This initializes a variable that we never use. But if o, the only lower-case character in the program, is deleted, it's instead initializing _.
O_=65: Same but for upper-case.
@_=->{: Start the loop definition.
$_[__=''<<$.+_]: Check for the presence of a specific letter in the string (starting with "a".)
?$_[__]=''<<$.+(_^32): If it's there, swap its case.
:$.+=1: Otherwise, move on to the next letter.
$.<27&&@_[]}: Either way, repeat the loop as long as we haven't reached the end of the alphabet.
_&&=@_[]: If _ has been defined, run the loop. If it was defined as 97, we'll be caseswapping letters starting with 'a' (character code 97). If it was defined as 65, we'll start with 'A'.
$><<$_: Output.

The loop is genius. I like the workaround to avoid -p too.

C (gcc), 78 76 73 72 68 bytes
__(_,$){$="";_[""-$]&&__(_+1,_[""-$]^=_[""-$]-('Aa'^32u)<26U?32:0);}

Try it online!
C (clang), 66 bytes
__(_,$){$="";""[$=_-$]&&__(_+1,""[$]^=""[$]-('Aa'^32u)<26U?32:0);}

Try it online!
Thank @G.Sliepen for fixing code for tio and pointing that the optimize work on clang!

Tried on duck.ac with extra __attribute__((optimize("-O0"))), works fine

Very nice trick with ""-$ to get around the need for char*!

@G.Sliepen $-'a'<26 is signed

@G.Sliepen If uppercase removed 26U turns into 26

Ah, never mind! I forgot about that.

can you please explain this one? I have no idea how this answer works

Some of the tricks used: in _[""-$2], the only pointer is "", $2 is an int but has the same value as the address of "", so they cancel each other and ""-$2 is basically (char *)0. Then, _[""-$2] is equivalent to (""-$2)[_], so basically (char *)0 + _, which means we get character at address _. Then to check whether to change case, 'Aa'^32 is 'a' for the upper case, 'A' for the lower case variant, or >255 otherwise. $-('Aa'^32u)<26U subtracts the previous value from the current character, makes it unsigned, and if <26 it is a candidate for case change.

@G.Sliepen Why don't ""[_-$] work same?

@l4m2 It works the same... when compiling with Clang. I think the main issue is that there is no guarantee that all four occurences of "" point to the same memory location, and with GCC and ""[_-$] that indeed isn't the case.

-2 bytes if you rename the function from __ to €

perl -p, 19 bytes
$A_=lc$_;$a_="\U$_"

Try it online!
A completely different solution than my earlier one. The program reads a line from the input (in the variable $_), does zero or more modifications, and prints that line (due to the -p flag). That is, it prints whatever ends up in $_.
As is, the input line isn't modified; its lower case variant is assigned to $A_, and its upper case variant to $a_, but both variables are otherwise ignored.
Removing the upper case letters gives us:
$_=lc$_;$a_="\$_"

Try it online!
Now, $_ is set to the lower case variant of itself. The variable $a_ is set to the literal string $_, but otherwise ignored.
If we remove the lowercase letters instead, we end up with:
$A_=$_;$_="\U$_"

Try it online!
Now we assign $A_ the input line, and ignore this variable. $_ is set to the uppercase variant of itself by using the special interpolation symbol \U, which upper cases the rest of the string, until it encounters \E, or the end of the string.

Very nice! ....

Just realised you could use lcA instead oflc$_ for -1.

Burlesque, 10 bytes
JZZzz#RjHD

Try it online!
This was a very fun one to puzzle out.
Explanation:
J            # Duplicate the input
 ZZ          # Uppercase it
   zz        # Lowercase it
     #R      # Rotate the stack right
       j     # Swap the top two elements in the stack (back to the original order)
        HD   # Hide the top (modified) element, returning the original input

Removing the lowercase letters gives us:
JZZ#RHD

Try it online!
Explanation:
J             # Duplicate the input
 ZZ           # Uppercase it
   #R         # Rotate the stack to the right
      HD      # Hide the top (unmodified) element, returning the modified input

And with uppercase letters removed:
zz#j

Try it online!
Explanation:
zz            # Lowercase the input
  #j          # Treats the stack as code to be run. Pops the string from the stack
              # and pushes it straight back in again to be implicitly output

Vyxal, 11 bytes
uN‹ß⇧:[,]_⇩

Full Program:
             # Implicit input, e.g. "Hello, World!"
uN‹          # Pushes '-1', negates it, and decrements, evaluating to `0`
   ß⇧        # Pops the top of the stack, and if it's truthy, converts the input to UPPERCASE. The top of the stack is '0', so this isn't executed
     :[,]    # Duplicates the top of the stack, and prints it if it is truthy, which it is
         _   # Discards the top of the stack
          ⇩  # Converts the input to lowercase
             # Implicit output is disabled

Output: Hello, World!

UPPERCASE PROGRAM:
            # Implicit input, e.g. "Hello, World!"
N‹          # Swaps the casing of the input and appends '-', evaluating to 'hELLO, wORLD!-'
  ß⇧        # Pops the top of the stack, and if it's truthy, converts the input to UPPERCASE. The top of the stack is a non-empty string, so this is executed
    :[,]    # Duplicates the top of the stack, and prints it if it is truthy, which it is
        _   # Discards the top of the stack
         ⇩  # Converts the input to lowercase
            # Implicit output is disabled

Output: HELLO, WORLD!

lowercase program:
           # Implicit input, e.g. "Hello, World!"
u‹         # Pushes '-1' and decrements, evaluating to '-2'
  ⇧        # Performs graded_up() on the top of the stack, evaluating to '0'
   :[,]    # Duplicates the top of the stack, and prints it if it is truthy. '0' is falsey, so it is not executed
       _   # Discards the top of the stack
        ⇩  # Convert the input to lowercase
           # Implicit output

Output: hello, world!
```

Vim, 5 bytes
VgUu$

Full Program:
V      # Enter Visual Line mode
 gU    # Change all characters to UPPERCASE
   u   # Undo
    $  # Go to end of line

UPPERCASE PROGRAM:
V    # Enter Visual Line mode
 U   # Convert all characters to UPPERCASE
  $  # Go to end of line

lowercase program:
gu$  # Convert all letters to lowercase from here to end of line

SNOBOL4 (CSNOBOL4), 114 96 bytes
	OUTput =inPUT :(enD)
Den	OUTPUToutput =REPLACEreplace(INPUTinput,&LCASEucase,&UCASElcase)
END
end

Try it online!
T  !
ry it online!
(Ab)uses SNOBOL's case-insensitivity and GOTO labels.

JavaScript (Node.js), 84 81 bytes
_=>_['A'?'slice'||'\164\157U\160\160\145\162C\141\163\145':'to\x4cower\103ase']()

Try it online!
Trivial one
JavaScript (Node.js) work if \123 was an error, 170 bytes
$=_=>_['A'?'slice'||(/A/,[,A,,S,,,O,,,E,C]=!1+{},[T,R]=!0+_,[U,N]=_._+_,$[C+O+N+S+T+R+U+C+T+O+R](`P='\\${U}0070'`)(),T+O+'U'+P+P+E+R+'C'+A+S+
Ea):'to\Zx4cower\Zx43ase']()

Try it online!
JavaScript (Node.js) strict, 186 184 bytes
(_,[,A,,S,,,O,,,E,C]=!1+{},[T,R]=!0+_,[U,N]=_._+_)=>0xE0?_:_['A'?(/A/,(_=>_)[C+O+N+S+T+R+U+C+T+O+R]('U',`U[0]='\\${U}0070'`)(U=[]),T+O+'U'+U+U+E+R+'C'+A+S+
Ea):'to\Zx4cower\Zx43ase']()

Try it online!

Ha, well there's a technique that would have saved  me a lot of time and bytes if I'd known about it :)

Oh, clever idea with the \\${U}0070. I thought of something ilke that but couldn't quite figure out how the escaping would work.

Attache, 243 bytes
{`+^^(_[0...#_]|{[[_,alpha[_2[ascii[33:58],_]]]["Z@"<_∧_<"["],NTS[20363848091226750223144960725905269888206028302]@_2[NTS[6060454347787589083238889994600682623947941084],_]]["z`"<_∧_<"{"]}&_2)}&({[`0,[$,`_3][_@_3=_2]][_3<#_][_,_2,_3+1]}&0)

Try it online!
At first, I wasn't sure if it was possible. However, this is in fact possible due to two key factors:

We have a lot of symbols at our disposal, including variable names in lambdas being accessible entirely symbolically: _, _2, etc.
We have the ascii variable to work with while having access to lowercase letters, and NTS (Number To String) while having access to uppercase letters. The former is simply a string consisting of the ASCII bytes 32 to 126. The latter is a function that takes a number and gives a string representation of it. The first long number corresponds  to the uppercase alphabet, and the second to the lowercase one.

Explanation
Now, for why this is such a troubling problem in this language. Attache functions are almost exclusively PascalCase, making them unsuitable for either computation. This means we do not have access to basic functions like string lookup, which we have to implement from scratch. This can be found at the end of the code:
{[`0,[$,`_3][_@_3=_2]][_3<#_][_,_2,_3+1]}&0
{                                       }&0    function with right parameter = 0
                                               parameters: string, search[, index = 0]
 [  ,                ][_3<#_]                  if index < length(string) then
     [ ,   ][_@_3=_2]                            if string[index] = search then
        `_3                                         yield a fn returning the index
      $                                          else yield this current function
  `0                                           else yield 0
                             [_,_2,_3+1]       call the result with the arguments, and index + 1

This snippet exhibits how we do conditional computation and recursion without letters. Thankfully, Attache has the Self reference $, which makes this leagues easier than it would be otherwise.
The main attraction takes this helper as a right argument, and is referenced (and passed manually down through scopes) as _2. I'll remove the body of the mapped function to explain how the main function works generally:
{`+^^(_[0...#_]|{-------}&_2)}&(-------)
                              &(-------)   saving the helper function as _2
{                            }             function taking a string as _
      _[0...#_]                            get characters of input
               |{-------}                  map each character by this function
                         &_2               (passing down _2)
 `+^^(                      )              fold concatenation, returning a string

Last, the function which tests each character and makes the conversion. The difference is made when testing for conditions. Two seperate conditions are checked:

"Z@"<_∧_<"["
"z"<∧<"{"`

Without any intervention, they both return false. We index into a nested array, obtaining arr[0][0], in which is placed the input. So, by default, the input is unchanged.
When removing uppercase letters, the first condition will become true for uppercase letters. When removing lowercase letters, the second condition will become true for lowercase letters. So, we have that arr[1] corresponds to the lower-to-upper transformation, and arr[0][1] corresponds to the upper-to-lower transformation. This is seen in this structure, where we index by the comparison.
[[_,--------]["Z@"<_∧_<"["],--------]["z`"<_∧_<"{"]

Both transformations have the form:
Desired[_2[Source,Element]]

That is, they find the index in the alphabet the mapped element belongs to, then index that into the other alphabet. For upper-to-lower, we can use alpha and ascii[33:58] to obtain the lowercase and uppercase alphabets, respectively. For lower-to-upper, we can use NTS on 20363848091226750223144960725905269888206028302 and 6060454347787589083238889994600682623947941084 to obtain the uppercase and lowercase alphabets, respectively. (These numbers are obtained by inputting the desired string to STN).
And with that, the program functions in all three cases.

Keg, 42 38 bytes
Turns out that ⟰ and ⟱ aren't implemented! That surely gives me a headache to implement that myself. (No TIO 'cuz the TIO interpreter has a bug. Use the offline interpreter instead.)
AAa!&ø?&¦3(:AZ•[ -]")|2(:za•[ +]")║_™^

Explanation
AAa                                    # Push the "magic string"
   !                                   # Find the length
    &                                  # Save the result into the accumulator
     ø                                 # Clear the stack
      ?&                               # Take input, append accumulator value
        ¦3(:AZ•[ -]")|2(:za•[ +]")║_™  # Default condition: directly return the input
                                     ^ # Reverse the stack

No lowercase letters:
AA!                                 # Here, the length of the "magic string" is 2
   &ø?&                             # Same as above
       ¦3                           # If the length of the stack is 2:
         (                          # Do this for every stack item:
          :AZ•                      # Is this in the A-Z range?
              [ -]                  # If so, lowercase it
                  ")|2(:•[ +]")║_™^ # Same as above

No uppercase letters works similarly.

Haskell, 90 bytes
(<$>)__
__ _'|0XA<1&&_'>'@'&&_'<'['||0xa<1&&_'>'`'&&_'<'{'=([_'..'~']++['?'..])!!32|1<2=_'

Try it online!

82 bytes.

Charcoal, 12 bytes
≡_¦_a↥Ｓ_A↧θＳ

Try it online! Link is to verbose version of code. Explanation:
≡_

Switch on _.
_a↥Ｓ

If it equals _a (i.e. never) then print the input uppercased.
_A↧θ

If it equals _A (i.e. never) then print the input lowercased.
Ｓ

Otherwise print the input unchanged.
With uppercase characters (including Ｓ) removed:
≡_¦_a↥_↧θ

Try it online! Explanation:
≡_

Switch on _.
_a↥_

If it equals _a (i.e. never) then print _ uppercased.
↧θ

Otherwise print the input lowercased.
With lowercase characters (including θ) removed:
≡_¦_↥Ｓ_A↧Ｓ

Try it online! Explanation:
≡_

Switch on _.
_↥Ｓ

If it equals _ (i.e. always) then print the input uppercased.
_A↧Ｓ

If it equals _A (i.e. never) then print the input lowercased.
Obviously both programs still work if you only delete ASCII upper/lowercase characters.

R, 127 bytes
aA=`\143`("\101-\132","\141-\172")
`\164`=1
`\143\141\164`(`\143\150\141\162\164\162`(aA[T+1],aA[t+1],`\163\143\141\156`(,"")))

Try it online!
This uses the octal code trick to write most of the code without letters.
In its unaltered version, it is equivalent to
aA=c("A-Z","a-z")
t=1
cat(chartr(aA[T+1],aA[t+1],scan(,"")))

Recall that T is the boolean TRUE and will be coerced to 1, so we are calling cat(chartr("a-z","a-z",scan(,""))) which will leave the input unchanged.
No lowercase
Remove the lowercase letters and you get code equivalent to
A=c("A-Z","a-z")
t=1
cat(chartr(A[T+1],A[+1],scan(,"")))

Try it online!
so we are calling cat(chartr("a-z","A-Z",scan(,""))), which will convert to uppercase.
No uppercase
Remove all uppercase characters and the code becomes equivalent to
a=c("A-Z","a-z")
t=1
cat(chartr(a[+1],a[t+1],scan(,"")))

Try it online!
This time, we are calling cat(chartr("A-Z","a-z",scan(,""))), which converts to lowercase.

Zsh, 30 bytes
:A&&1=$1:l
:a&&1=${(U)1}
<<<$1
Attempt This Online!
A T O!
ttempt his nline!
: is a command which does nothing and always succeeds, but both :A and :a don't exist and always fail.
Conveniently, Zsh has two ways to change the case of a string: ${(U)string}/${(L)string}, and $string:u/$string:l.

PHP (224 Bytes)
<?=!fPassthru(STDIN)&&0;__HALT_compiler();FUNCTIONfunction fPassthru(){returnRETURN STDIN;};functionFUNCTION __HALT_compiler(){ECHOecho                                                       STRTOUPPERstrtolower(STREAMstream_GETget_CONTENTScontents(Pfopen('php://stdin','r')));}

Uppercase version
<?=!P(STDIN)&&0;__HALT_();FUNCTION P(){RETURN STDIN;};FUNCTION __HALT_(){ECHO STRTOUPPER(STREAM_GET_CONTENTS(P('://','')));}

Lowercase version
<?=!fassthru()&&0;___compiler();function fassthru(){return ;};function ___compiler(){echo strtolower(stream_get_contents(fopen('php://stdin','r')));}

Befunge-98 (PyFunge), 51 bytes
<aaA^:~@#
, >-\:'``\'{^
^ 1>\:'@`\'[>\`**' *+
^ 01>

Try it online!
Try it online! (Uppercase letter removed)
Try it online! (Lowercase letters removed)
Explanation
Without removing any characters, most of the code is never executed. The code that does get executed is
<   ^:~@#
,
^
^   >

This reads each character sequentially with ~, duplicates it with :, and then prints the duplicate. Once the input runs out, ~ reflects the instruction pointer and @ ends the program. A copy of the input string is left on the stack, but it never gets printed, so we don't care about it.
With the uppercase A removed, the ^ on the top line moves one space to the left and the third line is executed rather than the second.
<  ^:~@#
,
^  >\:'@`\'[>\`**' *+
   1

This sequentially reads through the input with :~@# as before. Then, it puts a 1 on the stack, followed by two copies of the character. The two duplicates are compared against '@ and '[ (64 and 91 respectively) to see whether the character is an uppercase letter. If it is, the product of these checks (1*1=1) is multiplied by 1 and then by the code point of   (space) to get 32, which is then added to the original character to make it lowercase. However, if the character is not uppercase, one of the comparisons will return 0. This 0 gets multiplied by a bunch of things and then added to the original character, and so the character remains unaltered when it is printed.
With the lowercase as removed, the first ^ is now shifted over two spaces to the left, and the second line is executed rather than the fourth.
< ^:~@#
, >-\:'``\'{^
^ 1         >\`**' *+
  0

This does mostly the same thing, except -1 is pushed onto the stack rather than 1 at the beginning of the loop and the bounds are replaced with 96 and 123 (to see whether it is lowercase). Then, the ^ (we can't use v because it's lowercase!) shifts the IP down a line, to execute the same logic as before. If the character is a lowercase letter, 1 is multiplied by the top of the stack (which is now -1 rather than 1) and by 32 to get -32, which is added to the original character to make it uppercase. As before, if the character is not lowercase, 32 is multiplied by 0 and the final + does nothing.
In all cases,
<
,
^
^

is executed at the end of the loop, printing the possibly modified character and rerouting the IP back to the start.

Brachylog, 22 bytes
İḷ|f{;.P∧Ạ{∧Ṇ}ᶻ∋P∧|}ᵐ|

Try it online! try it online! TRY IT ONLINE!
I had some bizarre errors trying to use subscripted ∋/∈. Takes a string through the input variable and outputs through the output variable, since printing is impossible without lowercase letters.
İ                         The input is an integer, but it's not,
 ḷ                        ...
  |                       so maybe...
   f                      its factors, but it doesn't have factors...
    {;.P∧Ạ{∧Ṇ}ᶻ∋P∧|}ᵐ     ...
                     |    so just output it unchanged.

 ḷ                        The input converted to lowercase
  |                       is the output.
  |f{;. ∧ {∧ }ᶻ∋ ∧|}ᵐ|    Hooray, that worked, forget everything else.

İ                         The input is an integer, except it's not,
  | {              }ᵐ     so then instead for each element of the input
     ;.                   that element paired with the output it's mapped to
       P                  is P,
        ∧                 and
         Ạ                the lowercase alphabet
          {∧ }ᶻ           zipped with (I don't actually know why this works!)
            Ṇ             a list of all printable ASCII characters (ABCDEFGHI...)
               ∋P         contains P
                 ∧        (which isn't the output);
                  |       if that's impossible pass the element through unchanged.
                     |    Since that worked, we don't worry about the rest.

Haskell, 208 bytes or 210 bytes
Note: my original, shorter, solution was buggy. This one seems pretty solid. This challenge is not so easy in Haskell; there's no golfing here, aside from space removal. I imagine it's possible to do better.
(!)((/):($))((#):(*))(+)|(+)==(/)=(#)|0<1=(!)($)(*)(+)
(!)_ _(+)=(+)
(&)[(*)]=[]
(&)((*):(+))=(*):(&)(+)
_:(#)=(&)['@'..'[']
_:(%)=(&)['`'..'{']
(+*)|"A"==[]=(!)(#)(%)|"a"==[]=(!)(%)(#)|0<1= \(+)->(+)
(+*)<$>

The first seven lines are definitions. The last line is prepended to the input, like
(+*)<$>"My name is David."

If you don't accept this, you can upgrade to a "function" by enclosing in parentheses, at the cost of two bytes. To make a proper function definition, you'd turn on NoMonomorphismRestriction and write, say,
(##)=((+*)<$>)

Explanation
Haskell variables (including function names) generally have to start with a lower-case letter. Infix operators, however, can consist of various symbols, as long as they don't begin with a :. So ... all the functions defined and their argument names are written as operators. An operator enclosed in parentheses is treated as a regular old name, so this works. The case restriction prevents us from using any standard functions except infix ones, and also prohibits us from importing any modules. So we can't use fromEnum, toEnum, ord, chr, or unsafeCoerce to manipulate characters as numbers. Instead we write a function, (!), that looks for a character in a list, and produces the character in the same position in the second list if it's found. These lists are produced rather awkwardly using characters before and after the lower and upper case ASCII ranges and a hand-rolled version of init (called (&)).

Julia 1.0, 72 49 bytes
Zz=0;Yy=z=Z=0;~Xx=@.Xx+('`'<Xx+32Z<'{')*(32Z-32z)

Try all 3 versions online!
input and output are lists of characters

Lua, 111 bytes
bB=...aA=io or _G['\112\114\105\110\116'](('')['\117\112\112\101\114'](B))load"print(_G and bB or b:lower())"()

Try it online!
Lowercase Version
b=...a=io or _['\112\114\105\110\116'](('')['\117\112\112\101\114']())load"print(_ and b or b:lower())"()

Uppercase Version
B=...A=  _G['\112\114\105\110\116'](('')['\117\112\112\101\114'](B))"(_G  B  :())"()

Explanation
This code takes input as a command line argument, and can effectively be split up into two conditionals.
aA=io or _G['\112\114\105\110\116'](('')['\117\112\112\101\114'](B))

This segment is equivalent to aA=io or print(B:upper()), just written in a way to avoid lowercase characters for the print. Normally, this section of code does nothing because io is a truthy value. When lowercase letters are removed, io and or are removed, allowing the print to occur.
load"print(_G and bB or b:lower())"()

This segment is surrounded by a load call because without it, Lua will see this part as a syntax error when attempting to run the uppercase version. The uppercase version will throw a runtime error when it encounters this part, however.
The normal version will see _G as a truthy value and print the input as-is. The lowercase version will instead see _ as a falsy value and print the input in lowercase.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Chinese checkers adjacent squares
Challenge
You have a Chinese Checkers board looking like this:
board = [

              [''],
            ['', ''],
          ['', '', ''],
  ['', '', '', '', '', '', ''],
    ['', '', '', '', '', ''],
      ['', '', '', '', ''],
    ['', '', '', '', '', ''],
  ['', '', '', '', '', '', ''],
          ['', '', ''],
            ['', ''],
              ['']

];

Your job is that, given two inputs a and b (pointing to board[a][b]), you must return all the indices of the adjacent squares.
Example
Here are a couple examples:
0,0 => [1,0], [1,1]
1,0 => [0,0], [1,1], [2,0], [2,1]
3,6 => [3,5], [4,5]
5,2 => [4,2], [4,3], [5,1], [5,3], [6,2], [6,3]

Rules

You can assume that the input values a and b point to a valid position in the array
You can take in a and b as separate parameters, or an array [a,b]
The order of the output doesn't matter
You should not return the position being inputted

This is code-golf, so shortest code wins!

What are the neighbours of [2,0]? Should we include the ones diagonally adjacent (in the row below) as well?

Perhaps  you should explicitly state how all the positions are numbered. For instance, is $[0,0]$ the position at the very bottom? And if so, how is the position 3 rows up at the very left numbered?

The board appears to have a mistake.  I think you meant the following: Try it online!

The 4 players on left, and right side has only 2 rows. But the players on top and bottom has 3 rows. So it must have something wrong here. Maybe you should fix your board first before accepting an answer.

@jonah  I believe it should be like this, at least...

@jonah You've fixed the problem with the staggering of the points, but you still have top and bottom points bigger than the others. It should either be a small board (delete 3rd row from top and 3rd row from bottom) or a large board like tsh

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Explicit-ify APL expressions involving trains
Related: Clearly parenthesize APL trains
Background
In the most basic form, APL has two kinds of tokens: arrays and functions. For this challenge, we will use a lowercase letter a-z for an array, and an uppercase letter A-Z for a function. Furthermore, we will assume each character is a token of its own; Fx is equivalent to F x.
APL has two ways to call a function: monadic (taking one argument) and dyadic (taking two arguments). Monadic application is written in prefix F x, and dyadic one is written in infix x F y. There's nothing like "operator precedence"; an APL expression is always evaluated from right to left, which can be overridden with parentheses ().
x F G y -> x F (G y)
F x G y -> F (x G y)
x F y G z -> x F (y G z)
(F x) G H y -> (F x) G (H y)

A train is a way to compose functions to derive a more complex function. In essence, a train is formed when the rightmost token is a function. Here are the rules for 2- and 3-token trains:
(F G H) x -> (F x) G (H x)
(u G H) x -> u G (H x)
(G H) x -> G (H x)

x (F G H) y -> (x F y) G (x H y)
x (u G H) y -> u G (x H y)
x (G H) y -> G (x H y)

For 4-token and longer trains, the rightmost 3 tokens are recursively grouped to form a derived function until 2 or 3 tokens remain. As a whole, it can be thought of as follows:
Odd-length trains
(V D V D ... V D V) x -> (V x) D (V x) D ... (V x) D (V x)
x (V D V D ... V D V) y -> (x V y) D (x V y) D ... (x V y) D (x V y)

Even-length trains
(M V D V D ... V D V) x -> M (V x) D (V x) D ... (V x) D (V x)
x (M V D V D ... V D V) y -> M (x V y) D (x V y) D ... (x V y) D (x V y)

If an array u appears at the V position (other than the last), replace the cooresponding (V x) or (x V y) simply with u. An array appearing at M or D position is a syntax error.
Note that trains may also have sub-expressions that evaluate to an array or a function:
x ((D a) F G (u H J) K) y
   Expand 5(odd)-token train, leftmost V position being an array (D a)
-> (D a) F (x G y) (u H J) (x K y)
   Expand 3(odd)-token train (u H J)
-> (D a) F (u H (x G y) J (x K y))

Challenge
Given a line of APL expression that evaluates to an array (which may or may not include one or more trains), convert it into an equivalent expression without a train.
You can assume that the input is valid under the rules stated above, and it doesn't contain any spaces. You don't need to worry too much about parentheses or spaces in the output; lacking or redundant parentheses/spaces are fine as long as they represent the equivalent expression.
Standard code-golf rules apply. The shortest code in bytes wins.
Test cases
x(XY)y -> X(xYy)
uKKKv -> uKKKv
U(xVW)yZa -> UxVWyZa
MnP(QRsTU)VWx -> MnP(QVWx)RsTUVWx
x(XXxYYYdDD)y -> (xXy)XxY(xYy)YdDxDy
a((DEF)GHJ)Kb -> (D(aGKb)HaJKb)EF(aGKb)HaJKb
c((k(PQRSTU)m)(VW)(XY)(ZA)BCD)n -> V(P(kQm)R(kSm)T(kUm))WZ(XcYn)A(cBn)C(cDn)

explicitize

APL (Dyalog Classic), 63 59 58 54 52 51 bytes
∊⍎'.[A-Z].'⎕r'{0::&⍵⋄''() '',⍪⍺&⍵}'⊢'\w'⎕r'''&'''⊢⍞

Try it online!
put all letters in quotes, replace uppercase letters with dfns that return either "(left) self right" or "self right" depending on the presence of a left arg, and execute.

Python3, 887 bytes:
def p(s):
 r=[]
 while s and(S:=s[0])!=')':
  if S.isalpha():r+=[s[0]]
  if'('==S:r+=[(K:=p(s[1:]))[0]];s=K[1]
  s=s[1:]
 return r,s
F=lambda x:(O:=ord(str(x)[0]))<=91 and(64<O<91 or all(F(i)for i in x[-2:]))
R=lambda x:[i for i in x if i]
def f(s,l=0,r=0):
 if F(s):
  J=[]
  while s:
   if F(S:=s.pop(0))==0:J+=[S]
   else:
    if len(s)>1 and F(s[0])==0:J+=[[S,s.pop(0)]]
    else:J+=[S]
  s=J
  c,s=[f([*s[0]])]if(t:=F(s[0])==0)else[],s[t:]
  c+=[f(R([l,s[0],r]))]if(S:=sum(map(F,s))%2)else[];s=s[S:]
  while s:
   if F(s[0])==0:c+=[s[0]];s=s[1:];continue
   a,b=s[:2];c+=[a,f(R([l,b,r]))if F(b) else f(b)];s=s[2:]
  return f(c)
 c=[]
 while s:
  if F(j:=s.pop(0)) and type(j)==list:
   c+=[f(j,l=c and not F(c[-1])and c.pop(),r=f(s))]
  else:c+=[j]
 return c
P=lambda e,l=0:e if str==type(e)else '('*(Y:=(l>0 and len(e)>1))+''.join(P(i,l+1)for i in e)+')'*Y
M=lambda s:P(f(p(s)[0]))

Try it online!
This ended up being longer than I had originally anticipated, but this is an intriguing problem, and I thought I would add a non-APL, parsing-based solution.

Tamsin, 348 bytes
1=[2]->L&f->F&1->R&a(F,[L,R])|2.2="("&1->E&")"&E|"a"|"b"|"c"|"d"|"e"|"f"|"g"|"h"|"i"|"j"|"k"|"l"|"m"|"n"|"o"|"p"|"q"|"r"|"s"|"t"|"u"|"v"|"w"|"x"|"y"|"z".f="("&(f|2)/nil/list->T&")"&T|!(2|")")&any.a([F,G,H|T],A)=a(H,A)->L&a(F,A)->R&a(G,[L,R])->R&a([R|T],A).a([F|G],A)=a(F,A)->R&a(G,[nil,R]).a(F,[L,R])=n@F&R|1@F|n@L&''+F+R|'('+L+')'+F+R.n=“nil“.

Try it online!
Ungolfed version:
expr1 = [expr2] -> L & function -> F & expr1 -> R & apply(F, [L, R])
      | expr2.

expr2 = "(" & expr1 -> E & ")" & E
      | "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l"
      | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x"
      | "y" | "z".

function = "(" & (function | expr2)/nil/list -> T & ")" & T
         | !(expr2 | ")") & any.

apply([F, G, H | T], A) = apply(H, A) -> L
                        & apply(F, A) -> R
                        & apply(G, [L, R]) -> R
                        & apply([R | T], A).

apply([F | G], A) = apply(F, A) -> R & apply(G, [nil, R]).

apply(F, [L, R]) = n @ F & R
                 | expr1 @ F
                 | n @ L & '' + F + R
                 | '(' + L + ')' + F + R.

n = “nil“.

Unfortunately Tamsin does not have a easy way to match only uppercase/lowercase letters, so we need to do "a"|"b"|...|"z" for matching arrays, though we can take a shortcut for functions by just matching any char that cannot be matched as a array and is not ( and ) as a bonus this means symbols (like +, -, ×, etc.) are considered functions.


text:
Parse a Unicode vulgar fraction
Objective
Given a string with single Unicode vulgar fraction, parse it to a rational number.
Valid inputs
A valid input is one of:

¼ U+00BC; one quarter
½ U+00BD; one half
¾ U+00BE; three quarters
⅐ U+2150; one seventh
⅑ U+2151; one ninth
⅒ U+2152; one tenth
⅓ U+2153; one third
⅔ U+2154; two thirds
⅕ U+2155; one fifth
⅖ U+2156; two fifths
⅗ U+2157; three fifths
⅘ U+2158; four fifths
⅙ U+2159; one sixth
⅚ U+215A; five sixths
⅛ U+215B; one eighth
⅜ U+215C; three eighths
⅝ U+215D; five eighths
⅞ U+215E; seven eighths
⅟ (U+215F; fraction numerator one) followed by ASCII decimal digits (U+0030 – U+0039)
ASCII decimal digits followed by ⁄(U+2044; fraction slash) followed by ASCII decimal digits

There are exceptions. See below.
Invalid inputs
If the denominator is zero, the parser must fall in an erroneous state. This includes:

Monadic failing
Returning an erroneous value
Throwing an error

Rules

Encoding of the input doesn't matter.
Output type and format doesn't matter either. Though native rational number type is preferred, a pair of integers is permitted.
Inputs that are neither valid nor invalid fall in don't care situation. This includes:

Whole numbers
Improper fractions
Reducible fractions
Fractions with zero numerator
Negative fractions

Examples
⅛ (U+215B) parses to one eighth.
⅟13 (U+215F U+0031 U+0033) parses to one thirteenth.
24⁄247 (U+0032 U+0034 U+2044 U+0032 U+0034 U+0037) parses to twenty-four 247ths.
1⁄7 (U+0031 U+2044 U+0037) parses to one seventh. Note that ⅐ and ⅟7 will parse to the same.
0 (U+0030) falls in don't care situation. It's a whole number.
9⁄8 (U+0039 U+2044 U+0038) falls in don't care situation. It's an improper fraction.
4⁄8 (U+0034 U+2044 U+0038) falls in don't care situation. It's reducible to one half.
↉ (U+2189) falls in don't care situation. Its numerator is zero.
-½ (U+002D U+00BD) falls in don't care situation. It is negative.
1⁄0 (U+0031 U+2044 U+0030) must make the parser be in erroneous state. Its denominator is zero.
Ungolfed solution
Haskell
import Control.Monad
import Data.Ratio
import Text.ParserCombinators.ReadP as ReadP
import Text.Read
import Text.Read.Lex

fractionParser :: ReadP Rational
fractionParser = choice [
    char '¼' >> return (1 % 4),
    char '½' >> return (1 % 2),
    char '¾' >> return (3 % 4),
    char '⅐' >> return (1 % 7),
    char '⅑' >> return (1 % 9),
    char '⅒' >> return (1 % 10),
    char '⅓' >> return (1 % 3),
    char '⅔' >> return (2 % 3),
    char '⅕' >> return (1 % 5),
    char '⅖' >> return (2 % 5),
    char '⅗' >> return (3 % 5),
    char '⅘' >> return (4 % 5),
    char '⅙' >> return (1 % 6),
    char '⅚' >> return (5 % 6),
    char '⅛' >> return (1 % 8),
    char '⅜' >> return (3 % 8),
    char '⅝' >> return (5 % 8),
    char '⅞' >> return (7 % 8),
    char '⅟' >> do
        d <- readDecP
        guard (0 /= d)
        return (1 % d),
    do
        n <- readDecP
        char '⁄'
        d <- readDecP
        guard (0 /= d)
        return (n % d)
    ]

@l4m2 The percent symbol is not considered a fraction. So it falls in don't care situation.

In case it gladdens anyone's heart, I'll point out that Mathematica has a builtin, ToExpression, that converts a string to a number or other mathematical expression ... that utterly fails to understand these symbols  :)

@GregMartin Finally! Years after the upgoat incident, Mathematica's builtins' invulnerability takes a hit!

Related fun fact: the character ༳ (U+0F33) has a Numeric_Value property of -1/2.

@KrzysztofSzewczyk Seriously? Zero denominators are the only incorrect input.

Raku, 17 bytes
{S!\⅟!1/!.EVAL}

Try it online!
Returns a rational number type. Raku actually natively supports unicode literals and operators, though it doesn't do ⅟, so we need to substitute for that. Also, division by zero won't cause an error, but returns a value that causes an Exception when you try to use or print it.

The right tool for the job. :)

But what about for ["0/0","¼","½","¾","⅐","⅑","⅒","⅓","⅔","⅕","⅖","⅗","⅘","⅙","⅚","⅛","⅜","⅝","⅞","⅟13","24/247","1/7","1/0","⅟7"] {  say f $_ }   ;) The first exception crashes it and it does not look at the other elements! ;)

@MBaas 0/0 is not a valid input since the numerator is 0. Even if it wasn't, division by zero is meant to be an exception

Sure - but is that a reason not to evaluate the others? (I think "Invalid Inputs" indicated it should be handled)   ;)

'According to the Perl 6 FAQ, Perl 6 was designed to mitigate "the usual suspects" that elicit the "line noise" claim from Perl 5 critics'... Yeah, right.

PHP, 80 bytes
preg_match("~(\d+)/ ?(\d+)~",iconv('','US//TRANSLIT',$argn),$m);echo$m[1]/$m[2];

Try it online!
Just letting iconv do all the work for us ^^ this time PHP is competitive :O

JavaScript (ES6),  125 120  106 bytes
s=>([n,d]=s.split(/\D/),d)?(n||1)/d:'131111121234151357'[i=s.charCodeAt()%63%20]/-~'133689224444557777'[i]

Try it online!

Charcoal, 62 bytes
¿№θ⁄⪫⪪θ⁄¦/¿№θ⅟⭆θ⎇κι1/«§”)⧴≦Y�δ↥1≧Ｙ”℅θ/Ｉ⊕§”)¶@≦ＩＧ@℅⁵∧ψ”℅θ

Try it online! Link is to verbose version of code. Outputs a pair of integers separated with / for convenience. Explanation:
¿№θ⁄

If the input contains ⁄,
⪫⪪θ⁄¦/

then replace it with a /.
¿№θ⅟

If the input contains ⅟,
⭆θ⎇κι1/

then replace it with 1/.
«§”)⧴≦Y�δ↥1≧Ｙ”℅θ/Ｉ⊕§”)¶@≦ＩＧ@℅⁵∧ψ”℅θ

Otherwise look up the ordinal of the input in two compressed strings, one for the numerator, one for the denominator, and then increment the denominator (so that 1/10 can be handled).
Alternative version for 73 bytes:
¿№θ⁄«≔Ｉ⪪θ⁄θＩ∕§θ⁰⊟θ»¿№θ⅟«Ｉ∕¹Ｉ✂θ¹»Ｉ∕⊕§”)➙⧴ω⪪B⪪◨ιＹ”℅θ⊕§”)¶@≦ＩＧ@℅⁵∧ψ”℅θ

Try it online! Link is to verbose version of code. Output is a decimal fraction. Explanation:
¿№θ⁄«≔Ｉ⪪θ⁄θＩ∕§θ⁰⊟θ»

Handle the ⁄ case by dividing the numerator by the denominator.
¿№θ⅟«Ｉ∕¹Ｉ✂θ¹»

Handle the ⅟ case by taking the reciprocal of the denominator.
Ｉ∕⊕§”)➙⧴ω⪪B⪪◨ιＹ”℅θ⊕§”)¶@≦ＩＧ@℅⁵∧ψ”℅θ

Look up the decremented numerator and denominator in two compressed strings and divide their increments. (As I need the numerator as an integer anyway, incrementing it actually makes the string more compressible.)

Groovy, 96 bytes
import static java.text.Normalizer.*
def f={s->Eval.me(normalize(s,Form.NFKC).replace("⁄","/"))}

Try it online!
Uses Unicode Normalization to replace the digits with ASCII digits. Then replaces the fraction slash by an ASCII slash and evaluates the resulting string.

Python 3, 78 76 bytes
lambda s:eval(normalize('NFKC',s).replace(*'⁄/'))
from unicodedata import*

Try it online!
A lazy built-in solution in Python.
2 bytes saved by dingledooper.

76 bytes

Does the result conform to the output requirements? Although they allow any (complex, i. e. not simple) number type, I don’t think that numerical approximations are permitted. See my candidate for an explanation of an exact solution.

This was also my first impression after reading the task, but almost all other answers do the same thing, so I guess everybody is fine with that...

05AB1E, 90 88 65 bytes
gi•QλÖìʒ¨ù·'á!÷€āW•2ô2ÝƵ∞+14ÝŽX=+«çIkè`>/ëćÇŽX€åizë\ŽW&ç¡`D_iõEë/

Try it online or verify all test cases.
Explanation:
gi                       # If the length of the (implicit) input is 1:
  •QλÖìʒ¨ù·'á!÷€āW•     '#  Push compressed integer 131133161819122214243444155517375777
                   2ô    #  Split it into parts of size 2:
                         #   [13,11,33,16,18,19,12,22,14,24,34,44,15,55,17,37,57,77]
  2Ý                     #  Push list [0,1,2]
    Ƶ∞                   #  Push compressed integer 188
      +                  #  Add it to each value
       14Ý               #  Push list [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
          ŽX=            #  Push compressed integer 8528
             +           #  Add it to each value
              «          #  Merge the two lists together
               ç         #  Convert each to a character:
                         #   ["¼","½","¾","⅐","⅑","⅒","⅓","⅔","⅕","⅖","⅗","⅘","⅙","⅚","⅛","⅜","⅝","⅞"
                Ik       #  Get the index of the input in this list
                  è      #  Use it to index into the list we created earlier
                   `     #  Pop and push both digits separated to the stack
                    >    #  Increase the denominator by 1
                     /   #  And divide them by one another
 ë                       # Else (the length is not 1):
  ć                      #  Extract the first character of the (implicit) input
   Ç                     #  Convert it to a unicode integer-list
    ŽX€                  #  Push compressed integer 8543
       åi                #  If it's in the list (thus the first character was '⅟'):
         z               #   Push 1 divided by the remaining value
        ë                #  Else (the first character is not '⅟'):
         \               #   Discard the partial input
          ŽW&            #   Push compressed integer 8260
             ç           #   Convert it to a character "⁄"
              ¡          #   Split the (implicit) input by "⁄"
               `         #   Push both values separated to the stack
                D_i      #   If the top value (the denominator) is 0:
                   õE    #    Loop "" amount of times, resulting in an error
                  ë      #   Else:
                   /     #    Divide the two values by one another
                         # (after which the result is output implicitly)

See this 05AB1E tip of mine (section How to compress large integers?) to understand how all the compressed integers work.

Retina 0.8.2, 136 bytes
T`¼-¾⅐-⅟`L
B
1/2
D
1/7
E
1/9
F
1/10
G|H
$&3
A|C
$&4
[I-L]
$&5
M|N
$&6
[O-R]
$&8
[AGIMOS]
1/
H|J
2/
[CKP]
3/
L
4/
N|Q
5/
R
7/
⁄
/

Try it online! Link includes test cases. Explanation: By transliterating the UTF-8 characters to uppercase letters we can avoid massive UTF-8 encoding penalties which would otherwise make the shortest solution a series of replacements one for each fraction character (154 bytes in total). Instead I can squeeze out a few bytes by sharing replacements between fractions with the same denominator and then again with the numerator, particularly with fifths and eighths.

Python 3, 273 \$\cdots\$ 248 240 bytes
Saved 8 bytes thanks to pppery!!!
lambda s:{'¼':1/4,'½':.5,'¾':3/4,'⅐':1/7,'⅑':1/9,'⅒':.1,'⅓':1/3,'⅔':2/3,'⅕':.2,'⅖':.4,'⅗':.6,'⅘':.8,'⅙':1/6,'⅚':5/6,'⅛':1/8,'⅜':3/8,'⅝':5/8,'⅞':7/8}.get(s[0])or eval(s.replace('⁄','/').replace('⅟','1/'))

Try it online!
A straight-up mapping of Unicode vulgar fractions to their values (↉ (U+2189) falls into the "don't care" situation so throws an exception) or failing that, replaces ⅟ (U+215F) with 1/ (ASCII 49 + ASCII 47) and ⁄ (U+2044) with / (ASCII 47) and does an eval. So either returns the value (for valid input) or throws an exception (for invalid input).

Is there some reason that you can't remove '↉':1 entirely, thereby causing that value to be treated as invalid and throw an exception?

@pppery Oh yeah, of course. Nice one - thanks! :-)

Python 3, 153 151 bytes
lambda s:F(s.translate({8260:47,8543:"1/"}))if s[1:]else F(numeric(s)).limit_denominator()
from fractions import Fraction as F
from unicodedata import*

Try it online!

A not-so-lazy Python solution that returns the correct rational number as a fraction.Fraction instead of its floating point approximation.
Explanation
We need to distinguish between two cases:
Case 1: input length ≠ 1
Fraction( s.translate({ 8260: 47, 8543: "1/" }) )

Replace a couple of codepoints

826010 (U+2044, ⁄) → 4710 (U+002F, /)
854310 (U+215F, ⅟) → 1/

and parse the result as a Fraction.
Case 2: input length = 1
Fraction(unicodedata.numeric(s)).limit_denominator(10)

Convert the input codepoint into its floating point representation using unicodedata.numeric and subsequently as a Fraction. Unfortunately the intermediate representation as a floating point value loses some precision and we need to approximate the intended value using Fraction.limit_denominator and the knowledge of the largest occurring denominator 1,000,000 (actually 10 but the function’s default argument value is good enough).
Unfortunately we cannot merge the code paths for conversion to Fraction of both cases since the denominator limitation will return incorrect results for large denominators in case 1.

C (gcc) with -funsigned-char, 317 239 234 bytes
Thanks to ceilingcat for the changes!
To save some size, I preload the numerator with 1 (the denominator will usually be set to 0 on test failures so that the function will return an invalid value: generally NAN or INF, but some of the "don't care" inputs give other values.) I then look for the common cases and return the result.
It's a somewhat brute-forced function, given that I'm not using any character classification or normalization to assist: I decode the first byte to determine whether I'm looking at a precomposed fraction or not, and then apply rules from what is found.
#define S(x)strtol(x,&s,0)*!
n,d;float f(char*s){n=1;d=*s<58?n=S(s)0,*s|s[1]?s+=3,S(s)*s:0:*s-194?d=0[s+=2]-144,d<1?7:d<2?9:d<3?10:d<5?n=d-2,3:d<9?n=d-4,5:d<11?n=4*d-35,6:d<15?n=2*d-21,8:S(++s)*s:*++s<191?n=*s-187,4:0;return(n+.0)/d;}

Try it online!

Perl5:
perl -CiIO -Mutf8 -MUnicode::Normalize -pe '$_=NFKD$_'

Could you possibly add your byte count?

Ruby, 49 bytes
Prints a representation of a Ruby Rational type.
$_=eval $_.unicode_normalize(:nfkc).sub ?⁄,"r/"

Attempt This Online!