[Question]
  [
A digit word is a word where, after possibly removing some letters, you are left with one of the single digits:
ONE, TWO, THREE, FOUR, FIVE, SIX, SEVEN, EIGHT or NINE (not ZERO).
For example, BOUNCE and ANNOUNCE are digit words, since they contain the digit one.
ENCODE is not a digit word, even though it contains an O, N and E, since they are not in order.
Write a program/function which takes a single (uppercase or lowercase -- you choose) word as input or a parameter and determines if it is a digit word. Make the code as short as possible.
If the word is not a digit word, you should return 'NO', 0 or any 'falsey' value (this may vary based on your language). If the word is a digit word, you should output the digit it contains, as a number.
You can assume that no words contain more than one digit, so you won't have anything like ONFIVE.
***Test Cases***
```
BOUNCE
1
ENCODE
NO
EIGHT
8
BLACKJACK
NO
FABULOUS
NO
EXERCISE
NO
DRIFTWOOD
2
SERVICEMAN
7
INSIGNIFICANCE
9
THROWDOWN
2
ZERO
NO
OZNERO
1
```
*This challenge is taken from (and is a very slight modification of) Question 1 from [BIO 2009](http://www.olympiad.org.uk/papers/2009/bio/bio09-exam.pdf). Most of the test cases are taken from [the mark scheme](http://www.olympiad.org.uk/papers/2009/bio/bio09-marks.pdf).*
  
[Answer]
# Javascript (ES6), 101 99 bytes
```
f=
s=>-~'ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE'.split` `.findIndex(x=>s.match([...x].join`.*`))
```
```
<!-- snippet demo: -->
<input list=l oninput=console.log(f(this.value))>
<datalist id=l><option value=BOUNCE>
<option value=ENCODE>
<option value=EIGHT>
<option value=BLACKJACK>
<option value=FABULOUS>
<option value=EXERCISE>
<option value=DRIFTWOOD>
<option value=SERVICEMAN>
<option value=INSIGNIFICANCE>
<option value=THROWDOWN>
<option value=ZERO>
<option value=OZNERO>
```
[Answer]
# PHP>=7.0, 87 Bytes
```
<?for(;$i++<9;)levenshtein(IntlChar::charName("$i"),"DIGIT $argn",0,1,1)?:die("$i")?>NO
```
If only insertions of chars from one digit as word to the input is done exit the program with the digit.
Or change the order to `levenshtein("DIGIT $argn",IntlChar::charName("$i"),1,1,0)` to count not the deletions of chars
[levenshtein](http://php.net/manual/en/function.levenshtein.php)
[IntlChar::charName](http://php.net/manual/en/intlchar.charname.php)
# PHP>=7.0, 112 Bytes
```
for(;$i<9;)$r+=++$i*preg_match("#".chunk_split(substr(IntlChar::charName("$i"),6),1,".*")."#",$argn);echo$r?:NO;
```
[IntlChar::charName](http://php.net/manual/en/intlchar.charname.php)
# PHP, 128 Bytes
```
foreach([ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE]as$v)$r+=++$k*preg_match("#".chunk_split($v,1,".*")."#",$argn);echo$r?:NO;
```
[Try it online!](https://tio.run/nexus/php#Hc3NCoJAFEDhfY8xzcKfi9A2C1fXnM0dcNSCCBnEnLB0GM3XN2l94DunxBq749p1w5lRKUghKRavz9G1ujHeXRJCcZVQZDkipLLMIRUVghI3UFghAYpLVgAJwoee@OJzF57DkPeBdW1Xf/S8MWzPosZ8h76e7Ps1e3yBA7AoYH60Jfj//bhtzMhdciQZr@sP "PHP – TIO Nexus")
143 Bytes for more then 1 digit 
```
foreach([ONE,TWO,THREE,FOUR,FIVE,SIX,SEVEN,EIGHT,NINE]as$v)$r.=++$k*preg_match("#".chunk_split($v,1,".*")."#",$argn);echo+$r?strtr($r,[""]):NO;
```
[Try it online!](https://tio.run/nexus/php#Hc69CoMwFEDhvY@RZvDnInStFadrzZKAiVoQkSBWi62GaH19K50PfJxbbAZzotr2U0QUT/KScVFI5JKE@3O2nW4HpxIcQZUCVJohQiLyDBJWIEj2AIkFckB2TxVwxrHWC91caoPI9@noGdv1zUevB0POJGiH7zQ2i3m/VoducAESeMQNjgT/CTfs2mH2qY2X1a7WoRYqQmr3ykW47z8 "PHP – TIO Nexus")
[Answer]
# Mathematica, 83 bytes (WindowsANSI encoding)
```
±w_:=Rest@Position[Subsets@w~Cases~#&/@Characters@*IntegerName~Array~9,Except@{},1]
```
Defines a unary function `±` that takes a list of lowercase characters as input and returns either a digit, in a form like `{{7}}`, or else an empty list `{}`. I don't feel like I did a ton of golfy things here, except that `Characters@*IntegerName~Array~9` generates the number-name matches to look for without hard-coding them.
Example usage:
```
±{"i", "n", "s", "i", "g", "n", "i", "f", "i", "c", "a", "n", "c", "e"}
```
yields `{{9}}`.
[Answer]
# Python 3, 150 bytes
```
from itertools import*;lambda x:([i for i in range(10)if(*' OTTFFSSENNWHOIIEIIEORUVXVGN  ERE EHE  E   NT '[i::9],)in[*combinations(x+'  ',5)]]+[0])[0]
```
`combinations` returns all the combinations of things in order. It would be simpler to have a set number for the second parameter of `combinations`, so spaces are added onto the end of the original string that is a parameter of my lambda. That's a simple description of how my entry works. Ask if you would like any more clarification.
[Answer]
# [Jelly](https://github.com/DennisMitchell/jelly), ~~31~~ 28 [bytes](https://github.com/DennisMitchell/jelly/wiki/Code-page)
-2 bytes now that lowercase input is acceptable
```
“¡¦ẇṆb~ṇjṚØ%ĖġṘḥḞṾṇJḌ»Ḳe€ŒPT
```
A full program that expects lowercase input and prints the result, using `0` for the falsey case.
As a monadic link taking a list of characters it actually returns a list of integers which contains a single `0` in the falsey case, a single integer between `1` and `9` inclusive in the expected use cases and multiple such entries in cases where more than one number exists in the word.
**[Try it online!](https://tio.run/nexus/jelly#AVIArf//4oCcwqHCpuG6h@G5hmJ@4bmHauG5msOYJcSWxKHhuZjhuKXhuJ7hub7huYdK4biMwrvhuLLFknVl4oKsxZJQVP///0lOU0lHTklGSUNBTkNF)**
### How?
```
“¡¦ẇṆb~ṇjṚØ%ĖġṘḥḞṾṇJḌ»Ḳe€ŒPT - Main link: list of characters, s
“¡¦ẇṆb~ṇjṚØ%ĖġṘḥḞṾṇJḌ»       - dictionary lookup of "one two three four five six seven eight nine"
                      Ḳ      - split on spaces
                         ŒP  - partitions of s
                       e€    - exists in? for €ach
                           T - truthy indexes
```
[Answer]
# Ruby + [to\_words](https://github.com/taimur-akhtar/to_words): ~~49~~ 48+12 = ~~61~~ 60 bytes
Uses the flags `-rto_words -n`. Takes lowercase words. Returns `nil` if no "digit" found.
-1 byte now that lowercase input is allowed, allowing for the removal of the `i` flag on the regex.
```
p (1..9).find{|i|$_=~/#{i.to_words.chars*".*"}/}
```
For a more pure Ruby answer without external gems, 91+1 = 92 bytes:
```
p (1..9).find{|i|$_=~/#{%w"0 ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE"[i].chars*".*"}/}
```
[Answer]
# [Python](https://docs.python.org/), 148 bytes
```
from itertools import*
lambda s:[tuple(w)in combinations(s,len(w))for w in("x ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE "+s).split()].index(1)%10
```
An unnamed function taking an uppercase only word and returning the integer (`1` to `9`), or `0` for `NO`.
**[Try it online!](https://tio.run/nexus/python3#JY/BasMwDIbP61OIwKi9ZWW9FjZIE6X11tkQJ2nptkO7JmBI7BB7tG/f2d1B6PslIf1qX76u3aE/ng5gF5/ud@gacqZKw4/pj0ofnDLaEht3jfZ12poRzqA0iS4gOEK5FVCuC0TIRVVAzmoEyXYgsUYOyFbrEjjzg9GjpTM7dMoR@j1T@tRcyJzez58n7Wh6UK4ZnTGdBdUPZnQP13DJNdb5Y0Cipah4ilEcIU9FdoOw2@flJknf33x4zpNltRGVDO0dFimTYTIrWO59isyzxKJmKX4k3AvGJVtxlrM0@V/uPxHbTGxDc4@F8EnseQC6mNwNo9KOBE8xTJ9epzG0N0Xp9Q8 "Python 3 – TIO Nexus")**
### How?
For an input string `s` the function traverses through a list of the strings: `"x"`, `"ONE"`, `"TWO"`, `"THREE"`, `"FOUR"`, `"FIVE"`, `"SIX"`, `"SEVEN"`, `"EIGHT"` , `"NINE"`, and `s` itself looking for any matches.\*
The comparison used is whether this string, `w`, is one that may be formed from a combination of letters in order from the input. The function `combinations` gets these for us (and only the ones of the required length using `len(w)`), but they are in the form of tuples, so the strings are cast to tuples for the comparison.
Of the eleven results the one for `"x"` will always be `False`, while the one for `s` itself will always be `True`. The `"x"` is there to ensure the index of a match with `ONE` through `NINE` are the values required (since Python lists are 0-indexed), the `s` is there to ensure 
the call to `index(1)` (synonymous with `index(True)`) wont fail when no digit word was found, whereupon the resulting `10` is converted to a `0` with a modulo of ten using `%10`.
\* If `s` contains spaces for some reason, the list of `w`s will be longer, but the process will still work since the digit word matches will work the same way, and if none match the first space-split substring from `s` will match, once again giving `10` and returning `0`.
If multiple digit words exist the function will return the minimal one.
[Answer]
# [05AB1E](https://github.com/Adriandmen/05AB1E), 26 bytes
The falsy value here is **0**.
```
æ‘€µ‚•„í†ìˆÈŒšï¿Ÿ¯¥Š‘#å1k>
```
Explanation:
```
æ                           # Compute the powerset of the input
 ‘€µ‚•„í†ìˆÈŒšï¿Ÿ¯¥Š‘       # Push "ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE"
                     #      # Break on spaces
                      å     # Check each for membership
                       1k   # Get the index of 1 in the array (-1 if not found)
                         >  # Increment by one
```
Uses the **05AB1E** encoding. [Try it online!](https://tio.run/nexus/05ab1e#AUAAv///w6bigJjigqzCteKAmuKAouKAnsOt4oCgw6zLhsOIxZLFocOvwr/FuMKvwqXFoOKAmCPDpTFrPv//Qk9VTkNF "05AB1E – TIO Nexus") or [Verify all test cases!](https://tio.run/nexus/05ab1e#FYyxCsIwFEX39xVFVx0cXIU2TTVa8yBtrYh/4C4IDsFBnF0UB6mCToo6CG6FPjr5F/mRGodzz3K4y/mioqvRe7O6FW@jD0afjT7S3eiMbt81bcpteaJHkZef4lFcysy2dbq0Zp1q0WrTk3aWV41yx3GaHTuU1xrTysNEMg5cMvStRLcXgxe6bNC3QOB6SYhJBHzMFRMRB1@JIE4RfYi4GgnGh64EISPRlSIQzP2fxT2FqY@phAlXCDiRVj8 "05AB1E – TIO Nexus")
[Answer]
# [Japt](https://github.com/ETHproductions/japt), 52 bytes
```
1+`e two È(e fŒr five £x  v eight ÍÂ`¸a@v fX¬q".*
```
[Try it online!](https://tio.run/nexus/japt#AUsAtP//MStgwo1lIHR3byDDiChlIGbCjHIgZml2ZSDCo3ggwqB2woEgZWlnaHQgw43DgsKNYMK4YUB2IGZYwqxxIi4q//8iRkxPVFVTUiI "Japt – TIO Nexus")
[Answer]
# [Retina](https://github.com/m-ender/retina), ~~160~~ ~~126~~ 120 bytes
```
O.*N.*E
1
T.*W.*O
2
T.*H.*R.*E.*E
3
F.*O.*U.*R
4
F.*I.*V.*E
5
S.*I.*X
6
S.*E.*V.*E.*N
7
E.*I.*G.*H.*T
8
N.*I.*N.*E
9
\D
```
[Try it online!](https://tio.run/nexus/retina#JY1LDsIwDET3cw8klEUk/rBME7c1H1tKUooQC@5/iZKEhTUzb6Txaj18F7VGrCFskK2ZrVFsqxutiQXXZoe@YGumgrCvga151uaA1MILx@roj8sgTqDWDG0p4wxpub264BOwLJ1O4gkkXkMRHsaM7u787VoOveumu04J9KLoORFC5D7PqgGJ4pM9PZyAJfEg3LN3dSyPUeegs@BNUaFvqeJ@ "Retina – TIO Nexus")
Returns an empty string if the input does not contain a digit.
-6 bytes thanks to [@CalculatorFeline](https://codegolf.stackexchange.com/users/51443/calculatorfeline).
[Answer]
## Haskell, ~~113~~ 111 bytes
```
import Data.List
last.((`elemIndices`([]:words"ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE"))=<<).subsequences
```
[Try it online!](https://tio.run/##FY3RCoIwFEDf@4rLnhTCDwh9qLzmwDbQZUFIrpw0csvcos@3ejvn5Zy7dA81DPOszficPKTSy6jQzi/6ZJDOR0HQqkEZajt9U64Nzs3q85w6RzhDEEcOIi8RIeOHEjJaI1T0BBXWyADpLhfAKEMShkkch5F7X516vZX9pWYjtYUEjBz3FwjGSVsf9SGcyYYf2BbJEkiFZU23uF@zv@VcYPGHtKTZb81T0sxf "Haskell – Try It Online")
Returns `0` if no digit is found.
Find all subsequences of the input word in the list of digits. Prepend an empty string `[]` at index 0 which is part of every subsequence. `elemIndices` returns a list of indices and `=<<` flattens them into a single list. Pick the last index. 
[Answer]
## JavaScript (ES6), 121 bytes
```
f=
s=>[...s].map(c=>a=a.map(s=>s.slice(s[0]==c)),a=`ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE`.split` `)&&1+a.indexOf(``)
```
```
<input oninput=o.textContent=f(this.value)><pre id=o>0
```
Returns the lowest detected digit or `0` if no digit was detected (+6 if `NO` is required).
[Answer]
# [Bash](https://www.gnu.org/software/bash/), 163 bytes
```
a=NO;case $1 in *O*N*E*)a=1;;*T*W*O*)a=2;;*T*H*R*E*E*)a=3;;*F*O*U*R*)a=4;;*F*I*V*E*)a=5;;*S*I*X*)a=6;;*S*E*V*E*N*)a=7;;*E*I*G*H*T*)a=8;;*N*I*N*E*)a=9;;esac;echo $a
```
[Try it online!](https://tio.run/nexus/bash#LY27DsIwEAR/xUUargtvdEoRRU645iKR8GhPliVooMj/y6wN5cxIu8kaHTnYEl1Vu9fb0UhKnlbW1Mw00x0CsC5wpgtaqRuIHu0KBdwWFLr96g44AR8Z9gV8aZrFAcKjDhicszhCKMT/@cQcFwscw/PjKkspiU4yqPTStdr5Lw "Bash – TIO Nexus")
```
a=NO;
case $1 in
 *O*N*E*)a=1;;
 *T*W*O*)a=2;;
 *T*H*R*E*E*)a=3;;
 *F*O*U*R*)a=4;;
 *F*I*V*E*)a=5;;
 *S*I*X*)a=6;;
 *S*E*V*E*N*)a=7;;
 *E*I*G*H*T*)a=8;;
 *N*I*N*E*)a=9;;
esac;
echo $a
```
Don't know RETINA but seems a straight port of that answer.
[Answer]
# [Java (JDK)](http://jdk.java.net/), 150 bytes
```
s->{for(var i=0;i<9;)if(s.matches("."+"ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE".split(" ")[i++].replaceAll(".","*$0.")+"*"))return i;return"NO";}
```
[Try it online!](https://tio.run/##VVFdT6wwEH3nV0yaa0JdbHy9FzVh2aK9V9sE9sNofKgI2pUFQssmxuxvXwussrfJZObMnE7mzKzlVp6tX973alNXjYG1xaQ1qiB5W6ZGVSWJDoHvOHX7XKgU0kJqDXdSlfDpOACHtDbSWLet1AtsbNFNTKPK18cnkM2rxpYL9n23uxiqHojndZaaK8jhEhxnr8@uPvOqcbeyAXV57quL3z5WuavJRpr0LdMuImiCBKcwXwmY38SUQiQWMURsSSFh95DQJeVA2fXNHDjjFBFdF8q4CBB@VJPJE2myupBpFhRF181Dp7/OCcITdIowbjLTNiUofwgQF8jf7f1@@B9FJtNG24EHTQBoKhY8pMj7xpSHYnaMu2lGOL0Nwn9/rY2pKJgubsUiOfpzT@OQJUddZjGLrGoxG1MJjZcspHcBH3OMJ@yas4iFwX9D2WWJ1UysjqgPNBYjEg@8wz3c@U7v7THgcMpeNvwZ1OMf8cmHNtmGVK0htaWZ3EUn@qTsrUReT/cgJ7Kuiw@3QxgP@9w5ne32Xw "Java (JDK) – Try It Online")
## Saves
* 167 -> 153: various optimization thanks to @KevinCruijssen
[Answer]
# [Brachylog](https://github.com/JCumin/Brachylog), 57 bytes
```
∧"ONE
TWO
THREE
FOUR
FIVE
SIX
SEVEN
EIGHT
NINE"ṇi₁Ph⊆?∧Pt
```
[Try it online!](https://tio.run/##SypKTM6ozMlPN/r//1HHciV/P1eukHB/rhCPIFdXLjf/0CAuN88wV65gzwiuYNcwVz8uV093jxAuP08/V6WHO9szHzU1BmQ86mqzB@oOKPn/XynYNSjM09nV19FP6b8fAA "Brachylog – Try It Online")
### Explanation
I think this could be shorter if `i` were reversible, but it doesn't appear to be.
```
∧"..."ṇi₁Ph⊆?∧Pt
∧                  Break unification with input
 "..."             String containing words ONE through NINE, newline-separated
      ṇ            Split on newlines
       i₁          [item, index] pair for some item in that list (1-based index)
         P         Call that pair P
          h        Its first element (the word)
           ⊆       is a non-contiguous substring of
            ?      the input
             ∧     And
               Pt  P's last element (the index) is the output
```
[Answer]
# [Python](https://www.python.org), ~~125~~ 123 bytes
```
f=lambda b,x=9,i=0:x and f(b,x-1)+x*all(i:=b.find(c,i)+1for c in"NINE EIGHT SEVEN SIX FIVE FOUR THREE TWO ONE".split()[-x])
```
[Attempt This Online!](https://ato.pxeger.com/run?1=NVHBboJAEL3PV2w4QbuaYg9VEg4Ig25rdxMQMVoPqCHdhC7EYkLbT-nFS_tP_Y1-QRe0h0le3ryZeTPz-V291c-lOp2-jnXeG_585G6RvWz3GdnSxh1R6d44DcnUnuSmZnq2dd1cZUVhSsfd9nOp9uaOSuvazssD2RGpDM44EmST6ZzEuEBOYrYkIVsgCUUSkfk0QiTzVBDB0ei_VoWsTWvdazbWxcJv4xqGAWORcB_BBkDuiwCBCw3bvjAEGM88_-FeR0eH3jiZiSQ-a5YY-Sw-FwQRC_UwEcAAIMZowXx89DjcATAeswlnIfO9dtAIQHsTaSBS3opXGImuhVjxFtpdHtOW0_4uzo0nZVggVeU2a9txbjdQHmuNBx2G9iqSlvou5F1WptZRnbec6iBVbUqam9Ki5WXz_yf8AQ)
-2 bytes from @xnor, also fixing a misalignment with the spec
[Answer]
# [Factor](https://factorcode.org/) + `math.combinatorics math.text.english`, 53 bytes
```
[ all-subsets 9 [1,b] [ number>text ] map disjoint? ]
```
[Try it online!](https://tio.run/##LU8xTsRADOzzCj8AIlECEpSIhgZdFaXY3TiJj8RObC85DvH2sBEU1tgzo5GnD8lF99P769vLA8zBxzrJHIlDoSnZH6WBB/zfHS9eIw8T2QjrBoZrRk5FNnSri6rBYFF0/1qU2OGxqtbtG6LkYoPila4ADaNDnEL6OJeBPsQ8STbAC2oiQ@iUet9EuhKsn5RwDgzERgNTTykcYT6qbJ1sDFdUAbnyAT/V3kCYplvL8XgK7qG5u4ktNMB5jqhPRwloS6EFOrKzlDefod2Pu95/AQ "Factor – Try It Online")
Returns `f` for 'is a digit word' and `t` for 'is *not* a digit word.'
* `all-subsets` Get all the subsets of the input.
* `9 [1,b] [ number>text ] map` A shorter way to write `{ "one" "two" "three" "four" "five" "six" "seven" "eight" "nine" }`.
* `disjoint?` Do the sets not overlap? (This is 2 bytes shorter than saying `intersects?`.)
[Answer]
# PHP, ~~134 132~~ 128 bytes
```
<?=preg_match(strtr(chunk_split("#(ONE0TWO0THREE0FOUR0FIVE0SIX0SEVEN0EIGHT0NINE",1,".*"),[")|("]).")#",$argn,$m)?count($m)-1:NO;
```
run as pipe with `-nF` or [try it online](http://sandbox.onlinephpfunctions.com/code/04295a445b3a7764dcf1d95d9193dc0e412d11e9).
Creates a regex with the words in parentheses; i.e. each word `N` is in the `N`th sub-expression.  
If a word is found, the matched string will be in `$m[0]` and in the the `N`th element, with the elements between them empty and no empty string behind; i.e. `$m` has `N+1` elements.
[Answer]
## Javascript, 121 bytes
```
(s,a=0)=>'ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE'.split``.map((p,i)=>RegExp(p.split``.join`.*`).exec(s)?a=i+1:0)&&a
```
or 116
```
(s,a=0)=>' ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE'.split` `.map((p,i)=>a|=~s.search(p.split``.join`.*`)&&i)&&a
```
But just recycling material at this point.
[Answer]
# Pyth, ~~-44-~~ 41 bytes
```
+1xm}dyQc."EX%~)Û#lº,îQÓCe¯4Aô4"\P1
```
Takes a quoted string, outputs 0 for NO.
[Try it!](https://pyth.herokuapp.com/?code=%2B1xm%7DdyQc.%22EX%25%7E%29%C3%9B%23l%C2%BA%2C%C3%AEQ%C2%9C%C3%93Ce%C2%AF%C2%84%164A%C2%94%0E%C3%B4%C2%974%22%5CP%210&input=%22TOWOU%22&test_suite=1&test_suite_input=%22BOUNCE%22%0A%22ENCODE%22%0A%22EIGHT%22%0A%22BLACKJACK%22%0A%22FABULOUS%22%0A%22EXERCISE%22%0A%22DRIFTWOOD%22%0A%22SERVICEMAN%22%0A%22INSIGNIFICANCE%22%0A%22THROWDOWN%22%0A%22ZERO%22%0A%22OZNERO%22&debug=0)
### explanation
```
+1xm}dyQc."EX%~)Û#lº,îQÓCe¯4Aô4"\P1
         ."EX%~)Û#lº,îQÓCe¯4Aô4"      # Compressed string: "ONEPTWOPTHREEPFOURPFIVEPSIXPSEVENPEIGHTPNINE" (P is close to the other letters, makes the compression better)
        c                       \P    # split on P: ['ONE', 'TWO', 'THREE', 'FOUR', 'FIVE', 'SIX', 'SEVEN', 'EIGHT', 'NINE']
   m                                  # map over this list (variable: d)
    }dyQ                              # is d a (ordered) subset of the input (Q)? (= element of the powerset)
  x                                1  # get the index of the first true
+1                                    # add one, because the list was indexed at 0 and conveniently -1 (not found) becomes 0 
```
[Answer]
# Java, 254 bytes
```
int g(String a,String b){int i=0,p=0;for(char c:a.toCharArray()){p=i;i=b.indexOf(c);if(i<=p)return 0;}return 1;}
String f(String a){String[]T={"ONE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE"};for(String t:T)if(g(t,a)>0)return t;return"NO";}
```
[**Try Online**](http://ideone.com/wgzkc2)
```
boolean g(String a,String b)
{
    int i = 0, p = 0;
    for(char c:a.toCharArray())
    {
        p = i;
        i = b.indexOf(c);
        if(i <= p) return false;
    }
    return true;
}
String f(String a)
{
    String[]T={"ONE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE"};
    for(String t:T)if(g(t,a))return t;
    return"NO";
}
```
[Answer]
# C, 198 bytes
[**Try Online**](http://ideone.com/gt7A3M)
```
char*T[]={"ONE","TWO","THREE","FOUR","FIVE","SIX","SEVEN","EIGHT","NINE"};
g(char*a,char*b){while(*a&*b)a+=(*b++==*a);return!*a;}
i;char*f(char*b){for(i=0;i<9;i++)if(g(T[i],b))return T[i];return"NO";}
```
[Answer]
# Python 2, 155 bytes
```
import re;lambda k:next((i for i,j in enumerate([re.search('.*'.join(list(s)),k)for s in'ONE TWO THREE FOUR FIVE SIX SEVEN EIGHT NINE'.split()])if j),-1)+1
```
An anonymous function searching for regex group. Not the best solution here in Python but an alternative way.
[Answer]
# [Vyxal](https://github.com/Vyxal/Vyxal), ~~9~~ 8 bytes
```
9'∆ċ?ṗṠc
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJBIiwiIiwiOSfiiIbEiz/huZfhuaBjIiwiIiwic2VydmljZW1hblxub3puZXJvXG50aHJvd2Rvd25cbmluc2lnbmlmaWNhbmNlXG5mYWJ1bG91c1xuYmxhY2tqYWNrXG5kcmlmdHdvb2Rcbnplcm9cbmJvdW5jZVxuZW5jb2RlXG5laWdodCJd)
-1 thanks to EmanresuA
9 bytes but faster:
```
9'∆ċ:?Þ∩=
```
[Try it Online!](https://vyxal.pythonanywhere.com/#WyJBIiwiIiwiOSfiiIbEizo/w57iiKk9IiwiIiwic2VydmljZW1hblxub3puZXJvXG50aHJvd2Rvd25cbmluc2lnbmlmaWNhbmNlXG5mYWJ1bG91c1xuYmxhY2tqYWNrXG5kcmlmdHdvb2Rcbnplcm9cbmJvdW5jZVxuZW5jb2RlXG5laWdodCJd)
The joys of having number to word built-ins!
## Explained
```
9'∆ċ:?Þ∩=
9'        # From the range [1, 9], keep only items n where:
  ∆ċ      #   n as a word
     ?Þ∩  #   under multiset intersection with the input
    :   = #   is the same. 
```
]