# 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 	global func func:					;the function uses fastcall conventions 					;ecx=first arg to function (ptr to input string) 	xor eax, eax			;reset eax to 0 	read_str: 		inc ecx			;increment ptr to string 		cmp byte [ecx], '0' 		jl read_str		;if the char isn't a digit, get next digit 		cmp byte [ecx+1], 'a' 		jle read_str		;if the char after the digit isn't a letter, get next digit 		cmp byte [ecx-1], '1' 		je tens 		;10-19 have different rules, so jump to 'tens' 		xor ebx, ebx		;reset ebx to 0 		mov bl, byte [ecx] 	;get current digit and store in bl (low byte of ebx) 		sub ebx, 0x30		;convert ascii digit to number 		mov dl, [lookup_table+ebx] ;get correct ordinal from lookup table 		xor ebx, ebx		;reset ebx to 0 		inc ebx			;set ebx to 1 		cmp byte [ecx+1], dl	;is the ordinal correct according to the lookup table? 		cmove eax, ebx		;if the ordinal is valid, set eax (return reg) to 1 (in ebx) 		jmp end			;jump to the end of the function and return 		tens: 		xor ebx, ebx		;reset ebx to 0 		inc ebx			;set ebx to 1 		cmp byte [ecx+1], 't'	;does it end in th? 		cmove eax, ebx		;if the ordinal is valid, set eax (return reg) to 1 (in ebx) 	end: 	ret				;return the value in eax section .data 	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@nk2ZaSADSV9RKepyll7eRKrfcVWIqUKg4DsFI190VmgJlbS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