[Question]
  [
**The Challenge**
The goal of this challenge is to determine whether a given String can be typed using only one line of a standard UK QWERTY keyboard.
This is `code golf`, so shortest solution in bytes wins!
---
**IO**
Input will be a single String of zero or more characters in the ASCII decimal range of 32-126 inclusive. 
You may assume for this challenge that an empty String requires no typing and thus can be typed using a single line.
You may take the input as a String, list of characters, or equivalent form for your language.
Output should be a truthy value for any String that can be typed using a single line, or falsey for one that cannot.
---
**Keyboard layout**
To clarify any ambiguity over what the standard keyboard layout is below is a list of keys available on each line, including alternate upper keys (accessed using shift).
* *Line 1*
	+ Standard: ``1234567890-=`
* *Line 2*
	+ Standard: `qwertyuiop[]`
* *Line 3*
	+ Standard: `asdfghjkl;'#`
	+ Uppercase: `ASDFGHJKL`
	+ Special: Caps Lock
* *Line 4*
	+ Standard: `\zxcvbnm,./`
	+ Alternate: `|<>?`
	+ Uppercase: `ZXCVBNM`
	+ Special: Shift
* *Line 5*
	+ Special: Space Bar
Alternate upper keys can only be pressed if Shift is also on the same line, and uppercase keys can only be accessed through Caps Lock or Shift. You really can only use one keyboard line!
---
**Test cases**
```
            -> true     (empty string)
45-2=43     -> true     (line 1)
qwerty      -> true     (line 2)
tryitout    -> true     (line 2)
Qwerty      -> false    (no shift or caps on line 2)
#sad        -> true     (line 3)
AsDf        -> true     (caps lock used)
@sDF        -> false    (no shift for alternate upper)
zxcvbn?     -> true     (line 4)
zxc vbn     -> false    (spacebar on separate line)
123abc      -> false    (multiple lines)
            -> true     (just space bar)
!!!         -> false    (exclamation marks cannot be printed by a single line)
```
  
[Answer]
# [Python 2](https://docs.python.org/2/), ~~130~~ ~~123~~ ~~121~~ 115 bytes
```
lambda s:any(set(s)<=set(l+l.lower())for l in["`1234567890-=","eqwrtyuiop[]","ASDFGHJKL;'#","ZXCVBNM\,./|<>?"," "])
```
[Try it online!](https://tio.run/##hZJdT8IwFIbv/RUn44ItAsoYfjIQJWj8SoyJMQKJ3ehkWtrSduKM/312I@KQEXvTnPZ5z3t6enisJozaSeAOE4Km3hiBPEI0NiVWprRabrqTbVIjbI6FaVkBE0AgpAPjuW43nObe/sHhbtU1KgaezYWKo5DxwUiH3fte//zi8ur6uFzS4dPj2cPp7c2wUtv5arU7@gSMkZVwEVIFgVkuW7BcJYBqG5SIcBaaeMpVDFJp9sXaWkqcZtV2nUam/CshIcVQz8EzXb6KFy6FsJ2DlYhDxSKV4v/Cd2uZA0RkRpuUgZyEgQLdNR9xCYzCWoKSROOf5xe6NXJwV/aCTXDmQJj/BpHE45zoRPb6q6KCEtOfRURhQZHCEHGORS7F54f/7tHO5mY7qzBoOgf/@kmOfOwhkbZCYo5E6pZmyOn1ZCHPL27pNCIq5GShkTmRvlwO0d8KXyOpIHMGbW0l3w "Python 2 – Try It Online")
---
# [Python 3](https://docs.python.org/3/), 111 bytes
```
lambda s:any({*s}<={*l+l.lower()}for l in["`1234567890-=","eqwrtyuiop[]","ASDFGHJKL;'#","ZXCVBNM\,./|<>?"," "])
```
[Try it online!](https://tio.run/##hZJrT8IwGIW/@yvewAc2BBQ2vDIQJWi8JcbEGIHEbnQyLV1pO3Eiv312w8Dkovv2rs85pz0tC@XAp0bkWt2IoKHdRyCOEA21SV5Ma9YkT7ZJifhjzDV96vocCHi0k3kuVwyzurd/cLhbtDKFDB6NuQwDz2ednhqb9632@cXl1fVxLqvGp8ezh9Pbm26htPNVqzfUH8j09Ihxj0rN1XI5XYf5lwUo1kHyACejhodMhiCkgl/0rbnGrBYrlmnMpMsa4lEM5RQ9UgeQ4U/OWrqSoiUPPekHMuH/pe9WvV1ERIJr1Acx8FwJqjoHMQE@hRWHrED9eQdr84wU3RQtdyOdZBDfeYNA4H5KdSJa7SXVml3GN4yIxJwiiSFgDPOUx@eH827Txh@dm79pUHiaXiQKhhxsIx73ITBDPM6LLVIG6o0h29lQ7DAg0mNkJhIplVpcvKflTb4GQkKSDSpcj74B "Python 3 – Try It Online")
-4 bytes, thanks to nedla2004
[Answer]
# [Retina 0.8.2](https://github.com/m-ender/retina/wiki/The-Language/a950ad7d925ec9316e3e2fb2cf5d49fd15d23e3d), ~~72~~ 71 bytes
```
`^([-=\d`]+|[][eio-rtuwy]+|(?i)[adfghjkls;'#]+|[\\bcnmvxz,./|<>?]+| *)$
```
[Try it online!](https://tio.run/##K0otycxL/K@q4Z7wPyFOI1rXNiYlIVa7Jjo2OjUzX7eopLS8EsjVsM/UjE5MSUvPyMrOKbZWVwYpiYlJSs7LLauo0tHTr7GxsweKKWhpqvz/z2Viqmtka2LMVVieWlRSyVVSVJlZkl9awhUI4SsXJ6ZwORa7pHE5FLu4cVVVJJcl5dmDaAUgg8vQyDgxKZlLAQwA "Retina 0.8.2 – Try It Online") Explanation: Each alternation matches a different row of the keyboard. The `(?i)` in the middle of the pattern causes the entire rest of the pattern to be matched case-insensitively. Edit: Saved 1 byte thanks to @KirillL.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E/wiki/Commands), ~~66~~ 47 [bytes](https://github.com/Adriandmen/05AB1E/wiki/Codepage)
```
žh…`-=«žS„[]«žTDu…;'#««žUDu"\,./|<>?"««ð)εISåP}O
```
Takes the input as a list of characters.
-19 bytes thanks to *@Emigna*. Completely forgot we had qwerty-keyboard constant builtins. :D
[Try it online](https://tio.run/##yy9OTMpM/f//6L6MRw3LEnRtD60@ui/4UcO86FgQK8SlFChsra58aDWIG@pSqhSjo6dfY2NnrwQSOrxB89xWz8NLA2r9//@PVjJR0lEyBWJdIDYCYlsgBokZK8UCAA) or [verify all test cases](https://tio.run/##yy9OTMpM/V9TVhls/6hhnoKGfaW9kqbCo7ZJCkr2lcGh/4/uy3jUsCxB1/bQ6qP7goFKomNBrBCXUqCwtbryodUgbqhLqVKMjp5@jY2dvRJI6PAGzXNbIw4vDaj1/6/z38RU18jWxJirsDy1qKSSq6SoMrMkv7SEKxDCVy5OTOFyLHZJ43IodnHjqqpILkvKswfRCkAGl6GRcWJSMpcCl6KiIgA).
**Explanation:**
```
žh                # Push "0123456789"
  …`-=            # Push "`-="
      «           # Merge them together
žS                # Push "qwertyuiop"
  „[]             # Push "[]"
     «            # Merge them togeter
žT                # Push "asdfghjkl"
  Du              # Duplicate, and toUppercase the copy
    …;'#          # Push ";'#"
        ««        # Merge all three together
žU                # Push "zxcvbnm"
  Du              # Duplicate, and toUppercase the copy
    "\,./|<>?"    # Push "\,./|<>?"
              ««  # Merge all three together
ð                 # Push a space
 )                # Wrap all string in an array
  ε   }           # Map each to:
   I              #  Take the input (list of characters)
    å             #  Check for each if it's in the current string of the map-iteration
     P            #  Take the product (1 if all are truthy, 0 otherwise)
       O          # Take the sum (either 1 or 0, so truthy/falsey), and output implicitly
```
[Answer]
# [Perl 5](https://www.perl.org/) `-pl`, 76 bytes
```
$_=/^( *|[\d`=-]+|[][wetyuio-r]+|(?i)[asdfghjkl;'#]+|[\\\/zxcvbnm,.|<>?]+)$/
```
[Try it online!](https://tio.run/##HYxdE4FAGEbv319RUzMkafRxRWI07t0Zu6FPIm3aTTL9divuznPmmVMmVW5zLh8d/TAURh3C8cnRfLVDPmoS1tYZ0ap@Dt1MQQGN0/PlestnA@l3wRjr71f0DIv7eNLNF66vKrLOOVi2ZjiWCY8mqViLfGBVmzFSM9j@DUg0iGFFvRSW1NvAfrfuIy70MaEHmBpmEEYggCiKH1KyjBSUa2X@BQ "Perl 5 – Try It Online")
The obvious regex approach.
[Answer]
# [Ruby](https://www.ruby-lang.org/) `-n`, ~~86~~ 81 bytes
```
p /^( *|[\d`=-]+|[\]\[wetyuio-r]+|(?i)[asdfghjkl;'#]+|[\\\/zxcvbnm,.|<>?]+)$/?1:0
```
[Try it online!](https://tio.run/##JYzLDoIwFET39yuaYCKIiAJuVKwmxL1ripGn4oNiW0QM325FWc2Zk8mwKmqkLJF5UNGo9UlydI1A7yAgfp2KpsqpwTqh4lzzQ55kp/PlelsOlf@IEPP9ip9RcR9P2tUaB7o2MPFsMZUSnLlhuY4NjzplogHBmlzQSsC@7woPE9hyL4MN93bQ3@Bfog5gZtlhFAP60FLktODSKL4 "Ruby – Try It Online")
[Answer]
# [JavaScript (Node.js)](https://nodejs.org), ~~99~~ ~~98~~ 95 bytes
```
x=>/^([-`=\d]+|[wetyuio-r[\]]+)$/.test(x)|/^([asdfghjkl;'#]+|[zxcvbnm,./<>?\\|]+| *)$/i.test(x)
```
[Try it online!](https://tio.run/##dc@9DoIwFIbh3asANRFUIKJOCGhC3J0BY4WiIFKllR/DvVeIcTGH9XnPN5wEFYgGefxgSkZCzCOTV6alHSVXOZle6M8at8SsfsVEyV3P92fyWFMZpkyq5KY7QzSMLtfklhqTUXf9roLinN3nqraxbM9rWhOm7Sj@rbgRkIySFKspuUiRNBzK8uDfVmtFN1dLKD1LnLMaKiyvY0ZeDGqH3tWIohDyHXUiyLfU2UP@fdzuSULboLTQl@gcQEWAUBTFjvkH "JavaScript (Node.js) – Try It Online")
-1 from the comment by @Kirill L. in the Retina answer.  
-3 thanks @Ismael Miguel and @Arnauld for their combined effort.
[Answer]
# [Perl 6](https://github.com/nxadm/rakudo-pkg), ~~102 101~~ 100 bytes
*-1 byte thanks to nwellnhof!*
```
->\a{max map {a.comb⊆comb $_~.lc:},|<eqwrtyuiop[] ASDFGHJKL;'# ZXCVBNM\,./|<>?>,' ',"`-="~[~] ^10}
```
[Try it online!](https://tio.run/##K0gtyjH7n1upoJamYKvwX9cuJrE6N7FCITexQKE6US85PzfpUVcbiFJQia/Ty0m2qtWpsUktLC8qqSzNzC@IjlVwDHZxc/fw8vaxVldWiIpwDnPy843R0dOvsbGzt9NRV1DXUUrQtVWqi66LVYgzNKj9X5xYqZCmoWRoZKykac0F5ZmY6hrZmiCLFJanAi1BEigpqswsyS8tQRIKRFejXJyYgsR1LHZJQ@I6FLu4IXGrKpLLkvLsUUUUgEJIIkBXJiYlIwkoKAA5/wE "Perl 6 – Try It Online")
Pretty standard implementation. There's probably a shorter regex based solution to this, but I don't know Perl 6's regex well enough to make an attempt.
[Answer]
# Java 10, ~~209~~ 208 bytes
```
s->{int l=0,t;for(var p:s){t=p.matches("[[0-9]`\\-=]")?1:"qwertyuiop[]".contains(p)?2:p.matches("(?i)[asdfghjkl;'#]")?3:"\\zxcvbnm,./|<>?ZXCVBNM".contains(p)?4:p.equals(" ")?5:9;l=l<1?t:l!=t?9:l;}return l<6;}
```
-1 byte thanks to *@TFeld*.
[Try it online.](https://tio.run/##bZLdbuIwEIXv@xSDuWgiSFp@diUS0uxPtXcgVUhVtQnSGmOoqXHSeMIuS7ntA/QR@yLUBFatxd5Ynm88xz5HXtAV9RbThx2TVGsYUKE2ZwBCIS9mlHEY7kuASZZJThUwZ4SFUPNkDNoNTWt7ZhaNFAWDISiIYKe9q40RABldNjGcZYWzogXkgXY3GOX@kiK759ohSXLp9ca/0tSLxsSNWwF5/M0LXJciy5Mx8Vmm0LxHO7kbt4MPg04s3ITq6Wx@v3iQ4Xl9P94JSJr@/cNWE7Vs@hdP/av4593322/Dga3UNUr8saTSCIGZ@xT0QhnJfivGQNYijHuBDLcFx7JQIPufw@0u3HvMy4k0Ho9WV5mYwtJovudB3UNUyDU6hFTp/Ku6ba8ddTs2PLi1GRZrgVmJNr35z8m6plObfNXXM5t80dc/bHIIKD6BYKgNW@0OnTCbgV3WajVy8gmqZKr@IRnzl/ISj9mM1hr50jcG/dw0USqHpIQ0qjMNs4XX5xcgDeUzp2K@zqWo4nSPN213bw)
**Explanation:**
```
s->{                    // Method with String-array parameter and boolean return-type
  int l=0,              //  Line-integer, starting at 0
      t;                //  Temp integer
  for(var p:s){         //  Loop over the characters
    t=p.matches("[[0-9]`\\-=]")?
                        //   If it's a character from the first line: 
       1                //    Set `t` to 1
      :"qwertyuiop[]".contains(p)?
                        //   Else-if it's a character from the second line:
       2                //    Set `t` to 2
      :p.matches("(?i)[asdfghjkl;'#]")?
                        //   Else-if it's a character from the third line
       3                //    Set `t` to 3
      :"\\zxcvbnm,./|<>?ZXCVBNM".contains(p)?
                        //   Else-if it's a character from the fourth line:
       4                //    Set `t` to 4
      :p.equals(" ")?   //   Else-if it's a space from the fifth line:
       5                //    Set `t` to 5
      :                 //   Else (invalid character):
       9;               //    Set `t` to 9
    l=l<1?              //   If `l` is still 0:
       t                //    Set it to `t`
      :l!=t?            //   Else-if `t` is a different line than `l`:
       9                //    Set `l` to 9 (non-existing line)
      :                 //   Else (`t` is the same line as `l`):
       l;}              //    Leave `l` the same
  return l<6;}          //  Return whether `l` is not 9
```
[Answer]
# Powershell, 87 bytes
*Port of Neil's [Retina regex](https://codegolf.stackexchange.com/a/173780/80745).*
```
"$args"-cmatch"^([-=\d``]+|[][eio-rtuwy]+|(?i)[adfghjkls;'#]+|[\\bcnmvxz,./|<>?]+| *)$"
```
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), 55 bytes
```
ØDW;Øq;Œu$€3,4¦;"“rɠ3“Ż²“¿µ|“aƲƘ0ÞḅzḂ»⁶ṭ
¢f€ẈṠSỊafƑ¢F¤$
```
[Try it online!](https://tio.run/##ddE9T8JAHAbwvZ/iKAyYQCK0TsS3hLAbBwfjcJSrFo@23F3VEgclMRo3nRiMIcQ46UKiARlMroHEj1G@SD2KShtLl3@a/p7nXlpHGLtB4HXKeyWv0yyN753MtP2i5FT@XJKnFw/kq6uIMR7xvhj8k7@diwkn/Uln1Xv0B1ctf9Dmo@nluz98lXhPF2n/48Yfdnf90S3UJ3e8V@FPmcC7Fl@CYF@S5RyIPOn8BmDEQeFLFjVs5gLKiGEerkiyupYvrqvKTyJOsWEiUBCoeYoIc39bE1BRIEZcg1kOm7MlaOdfkw4xDVXWtAA9MnQGLAI0aFNgmeAvmKawtjhWQrsi0DYt68tQ2Igt7Rg4FNUE3qLlShwnbEUXe4GYIWJChoBj24iIaOtMO6mam8svTZ0jIFQELfqpDTVUhWR2RIpsSGbts6TIFYoKrGrJV9RwMDNsPLdUYBD71fGd1B3KQLgSEEsJnEqlIjzSLB18Aw "Jelly – Try It Online")
The first line yields a list of the keyboard lines and the second one checks whether the program input is contained on a single (or zero) lines and that there are no characters that can't be typed (like `QWE!@#`).
[Answer]
# [C](http://clang.llvm.org/), 150 bytes
```
x;f(char*s){for(x=0;*s;x|="@               "[*s++-32]);return!(x&x-1);}
```
[Try it online!](https://tio.run/##hdG9TsMwEADg4TJYnfwIFyOQnRKpTWCyIorECzBTBjdtIBK4YLvgUvrswWmAqYazTv75TrqTXOf1k9IPXedlw@tHZTIrds3acF9NZGal/6zYDIDCkIAJYvIbQPt7LxQoHfIQ3xsQJAAJRaQkWJ@IJAQlQcICBGB3mR2P87K4F9Ks3MbolPszn0@F3HetdvisWs0F7kaILyY8NJydLueanWM4MSHkUbi4zIuqKKP@@r4ybhtlZ7atW29ctODEqmUUr@1NE8UPX78t9FXUEfFgR/H277Fn/zTG0Dnq06JUizrKaZr@zDX8E07kaN99AQ "C (clang) – Try It Online")
It won't win any prizes, but this is a fun approach: we map characters on the five rows of the keyboard to `4 8 16 32 64`, and every invalid character to `3`. We bitwise OR the value for each character in the string together, and check if the result satisfies `x&(x-1) == 0`, which is true when `x` is a power of 2 or zero, i.e. whenever `x` has at most one bit set.
[Answer]
# [LUA](https://www.lua.org), 282 262 259 270 bytes
```
s=io.read()l=0
t=0
for c in s:gmatch"."do
f=c.find
t=f(c,"[0-9%`-=]")or 0|(f(c,"[qwertyuiop%[%]]")or 0)*2|(f(c,"[aAsSdDfFgGhHjJkKlL:'@#~]")or 0)*4|(f(c,"[\\zxcvbnm,./|<>?ZXCVBNM]")or 0)*8|(f(c," ")or 0)*16
t=t==0 and 17or t
l=l<1 and t or l~=t and 17or l
end
print(l<17)
```
[Try it online!](https://tio.run/##yylN/P@/2DYzX68oNTFFQzPH1oCrBIjT8osUkhUy8xSKrdJzE0uSM5T0lFLyudJsk/XSMvNSgGrSNJJ1lKINdC1VE3RtY5U0gRoMajQgooXlqUUllaWZ@QWq0aqxUElNLSOYfKJjcXCKS5pbunuGR5ZXtneOj5W6g3IdXKEJTGFMTFVFcllSXq6Onn6NjZ19VIRzmJOfL1yhBVShAkzA0AzotBJbWwOFxLwUBUNzoGgJV45tjo0hWKBEASiQU2dbgpDO4UoF@qegKDOvRAOozFzz//@SotRyAA "Lua – Try It Online")
[Answer]
# PHP, 98 bytes
I´m a little sad that there´s nothing shorter than regex. It´s probably not the fastest solution.
```
<?=preg_match("%^([`\d=-]*|[wetyuio-r[\]]*|(?i)[asdfghjkl;'#]*|[\\\zxcvbnm,./|<>?]*| *)$%",$argn);
```
Run as pipe with `-F` or [try it online](http://sandbox.onlinephpfunctions.com/code/73e917278f07b7ced2d422001f6656774ae05cba).
---
Shortest non-regex solution I found (124 bytes; linebreak and tab for reading convenience):
```
foreach(["`1234567890-=","qwertyuiop[]","asdfghjkl;'#ASDFGHJKL","zxcvbnm,./\|<>?ZXCVBNM"," "]as$d)
    trim($argn,$d)>""||die(1);
```
exits with code `1` for truthy, `0` for falsy. Run as pipe with `-R`.  
Requires PHP 5.4 or later; for older PHP, use `array(...)` instead of `[...]` (+5 bytes)  
```
foreach(split(_,"`1234567890-=_qwertyuiop[]_asdfghjkl;'#ASDFGHJKL_zxcvbnm,./\|<>?ZXCVBNM_ ")as$d)
    trim($argn,$d)>""||die(1);
```
[Answer]
# [AWK](https://www.gnu.org/software/gawk/manual/gawk.html), ~~163~~ ~~119~~ 113 bytes
This is an AWK answer, returns a numeric 1 string for true, 0 string for false.
(Written as AWK invoke as awk -f file for interactive use.)
```
{print/^[-`1234567890=]*$/||/^[]qwertyuiop\[]*$/||/^[asdfghjkl;'#ASDFGHJKL]*$/||/^[zxcvbnm,.\/\|<>?ZXCVBNM]*$/||/^ *$/}
```
[Try it online!](https://tio.run/##SyzP/v@/uqAoM69EPy5aN8HQyNjE1MzcwtLANlZLRb@mBigaW1ieWlRSWZqZXxATDRdNLE5JS8/Iys6xVld2DHZxc/fw8vaBy1ZVJJcl5eXq6MXox9TY2NlHRTiHOfn5wuQVgHTt//95VRV6eUlVFUkVSVxRfnZ@zmW5OkBusk5Znl6UX0SyXp4eF9Dy/KLK/MrY6FguI2NLEzPLBMOEhARdkERlUV4al7lFVhlXYLgrAA "AWK – Try It Online")
However, does not handle TAB character as written (trivial extension) as not part of spec. 
[Answer]
# [Bash](https://www.gnu.org/software/bash/), 119 bytes
Includes an echo to provide "readable" output. If you put a suitable wrapper of shell (your choice) around it to include print/output, then you can save 8 bytes. My reading of the challenge suggests the solution should output a suitable output indication so I stick with 119 bytes.
```
[[ "$@" =~ ^[asdfghjklASDFGHJKL\;\'#]*$|^[-\`0-9=]+$|^[]qwertyuiop\[]*$|^[zxcvbnm,./\|\<\>\?ZXCVBNM]*$|^\ *$ ]];echo $?
```
[Try it online!](https://tio.run/##S0oszvj/PzpaQUnFQUnBtk4hLjqxOCUtPSMrO8cx2MXN3cPL2yfGOkZdOVZLpSYuWjcmwUDX0jZWG8SJLSxPLSqpLM3ML4iJhshXVSSXJeXl6ujpx9TE2MTYxdhHRTiHOfn5gqVjFLRUFGJjrVOTM/IVVOz//w8EG/AfAA "Bash – Try It Online")
]