# x86 machine code, 65 bytes

    00000000: 31c0 4180 3930 7cfa 8079 0161 7ef4 8079  1.A.90|..y.a~..y
    00000010: ff31 7418 31db 8a19 83eb 308a 9300 0000  .1t.1.....0.....
    00000020: 0031 db43 3851 010f 44c3 eb0a 31db 4380  .1.C8Q..D...1.C.
    00000030: 7901 740f 44c3 c374 736e 7274 7474 7474  y.t.D..tsnrttttt
    00000040: 74                                       t


Assembly:

<pre><code>section .text
&#9;global func
func:&#9;&#9;&#9;&#9;&#9;;the function uses fastcall conventions
&#9;&#9;&#9;&#9;&#9;;ecx=first arg to function (ptr to input string)
&#9;xor eax, eax&#9;&#9;&#9;;reset eax to 0
&#9;read_str:
&#9;&#9;inc ecx&#9;&#9;&#9;;increment ptr to string

&#9;&#9;cmp byte [ecx], '0'
&#9;&#9;jl read_str&#9;&#9;;if the char isn't a digit, get next digit
&#9;&#9;cmp byte [ecx+1], 'a'
&#9;&#9;jle read_str&#9;&#9;;if the char after the digit isn't a letter, get next digit
&#9;&#9;cmp byte [ecx-1], '1'
&#9;&#9;je tens &#9;&#9;;10-19 have different rules, so jump to 'tens'
&#9;&#9;xor ebx, ebx&#9;&#9;;reset ebx to 0
&#9;&#9;mov bl, byte [ecx]  &#9;;get current digit and store in bl (low byte of ebx)
&#9;&#9;sub ebx, 0x30&#9;&#9;;convert ascii digit to number
&#9;&#9;mov dl, [lookup_table+ebx] ;get correct ordinal from lookup table
&#9;&#9;xor ebx, ebx&#9;&#9;;reset ebx to 0
&#9;&#9;inc ebx&#9;&#9;&#9;;set ebx to 1
&#9;&#9;cmp byte [ecx+1], dl&#9;;is the ordinal correct according to the lookup table?
&#9;&#9;cmove eax, ebx&#9;&#9;;if the ordinal is valid, set eax (return reg) to 1 (in ebx)
&#9;&#9;jmp end&#9;&#9;&#9;;jump to the end of the function and return

&#9;&#9;tens:
&#9;&#9;xor ebx, ebx&#9;&#9;;reset ebx to 0
&#9;&#9;inc ebx&#9;&#9;&#9;;set ebx to 1
&#9;&#9;cmp byte [ecx+1], 't'&#9;;does it end in th?
&#9;&#9;cmove eax, ebx&#9;&#9;;if the ordinal is valid, set eax (return reg) to 1 (in ebx)

&#9;end:
&#9;ret&#9;&#9;&#9;&#9;;return the value in eax
section .data
&#9;lookup_table db 'tsnrtttttt'
</code></pre>

[Try it online!][TIO-jotbvj4j]

[Bash]: https://www.gnu.org/software/bash/
[TIO-jotbvj4j]: https://tio.run/##rVZtb@JGEP5s/4oRusgmwcQ2VxXw5SpVvarf7gcEhNbrNThn76LdNXGV8tvTmTUmEN2p/XBIMfvyzDMzz8yY5MzsXjmz8OnTl69/wme4t83@nk2ZaSADSV9RKepyll7eRKrfcVWIqUKg4DsFI190VmgJlbSw2TBrdZW3Vmw2YVgyYzmr6/EYylbykO@Yvh1n4DeskuH4xXcHVhhrHtcPLyt/NUoTY1ejCa6SVBan1XmR2t1pdUZdrJJksUhnCf7NT495v02TWZLOFvFiHs8Hhvl59UsyrNKzy/lMDz7fVnGPi/1j5pdKh5Rx9RBnfQLVOqvu7jCpvcaLMlyNbswSboqVRKMBMnE6DLvxOPOP/nE0VMDYNp/yDHXwt5xfC47luARdlSKSKtpXAqJmljprlT8VbbOH6I8rHLopxAEZCqH1NdBcAf8BK8QlGE@2WiDuCwSPcbRYv3w8QoCnvLUQ5fBr9DElKw1RAcFKBm8bB3N05GAnuqntLB49Y4Icv9nzNwhenGjwIblPj4TvNYTRSt7e3v7@txXAVSvtEncreWNWcgQfQurgaPydrFxjRuJk/pfoKEeyRaUvsdB1BUQY5v59cHTx@T2trRpxXZFXI7itlISpxSnwvW2tcla7ZvfpsfTok9mdcGcO2hphYJgMTEsehKQL4/dgwbuHstLGAtNbsOrNMtyjpHhQyT2qbnDQ5Hbse53SIFg3oQcRaGGEpQ1hY9/TghUbRC/RQSU5jq2D4VKLBn3DibYn9BHFsSNyEv0RsesJBHGAp081DFRkXgKlRRMMlZEBhgtFta3sBLboXqIe/f49311CjKxnFD@iZCW@VNzWkZxd1MLixX/5iJyPxPkQ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